npm error code EINVALIDTAGNAME when trying to install protobufjs

19,712

Solution 1

Where did you find that syntax?

Square brackets in the instructions for how to run something generally mean that the part in square brackets is optional. i.e. that you can run the command with or without the part in square brackets.

For npm you can run:

npm install protobufjs

or

npm install protobufjs --save-prod

or

npm install protobufjs --save-dev

etc., depending on what you're trying to do.

I believe older versions of npm used --save instead of --save-prod and in later versions of npm, --save-prod is the default.

$ npm --version
6.4.1
$ npm install protobufjs
npm notice created a lockfile as package-lock.json. You should commit this file.

+ [email protected]
added 14 packages from 35 contributors and audited 16 packages in 4.502s
found 0 vulnerabilities

Solution 2

Just simply use the following Syntax #nodejs #Express

 npm install protobufjs

Insted of :

 npm install protobufjs --save-prod

or

 npm install protobufjs --save

Because the newer version of Nodejs by default having --save method

Share:
19,712
Fx Bayu Yunianto Pabisa
Author by

Fx Bayu Yunianto Pabisa

Updated on June 05, 2022

Comments

  • Fx Bayu Yunianto Pabisa
    Fx Bayu Yunianto Pabisa almost 2 years

    I got an error when installing protobufjs with this command:

    npm install protobufjs [--save --save-prefix=~]
    

    the error is:

    npm ERR! code EINVALIDTAGNAME
    npm ERR! Invalid tag name "[--save": Tags may not have any characters that encodeURIComponent encodes.
    

    How can I fix this issue?

  • Fx Bayu Yunianto Pabisa
    Fx Bayu Yunianto Pabisa over 5 years
    i found in npmjs.com/package/protobufjs sir thanks for help