i am trying to install supertest but in the terminal i get error, when i run supertest -v says command not found. after installing i get below error. any suggestion would be highly appreciated
i tried to install the dependency with using below methods
npm i/install supertest
2, npm i/install --save-dev spuertest
3, npm i/install --save supertest
#MacBook-Pro Node_Cat_Supertest % npm install --save supertest
npm WARN cat_supertest#1.0.0 No description
npm WARN cat_supertest#1.0.0 No repository field.
supertest#6.0.1
updated 1 package and audited 137 packages in 1.355s
37 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
ahmadimranpopal#MacBook-Pro Node_Cat_Supertest %
Regards
IP
have you ever tried it as a root privileges? and got same results? sudo -i
have you ever tried installing as a global package? npm install <module-name> -g
have you ever tried to installing specific version of the package? npm install <module-name>#<version-name>
Related
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?
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.
+ protobufjs#6.8.8
added 14 packages from 35 contributors and audited 16 packages in 4.502s
found 0 vulnerabilities
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
As best answer says:
prefix=~]
that's the problm
in my case was just a + for this line:
npm install --save request request-promise cheerio puppeteer+
copy-pasting from website, make me do this mistake
hope it works
I am getting this error while installing any JS package , I have done lots of search but no luck. So please let me know where i am making mistake.
npm ERR! request to https://registry.npmjs.org/node-modules failed,
reason: error:0906D06C:PEM routines:PEM_read_bio:no start line
WebServer : Apache2(xampp)
Node : v9.3.0
NPM : 5.5.1
I think that first you need to start prompt as an administrator, then run npm cache clean -f then try to run npm install, by this command the npm will install the packages listed in package.json.
Or
You can run npm config set registry http://registry.npmjs.org/ so you can run npm install -g node-modules. Read more in this answer.
I faced the same problem and finally I was able to solve the exact above error by doing the following steps:-
check version of your npm with npm -v
run npm -g install npm#<version> This step is important as npm is getting installed globally here.
Now run the command where you want to install something globally using npm. In my Case the command was npm install -g #angular/cli#6.2.9 which worked fine after these changes
If you are still facing the problem, I would recommend to follow the instructions about installing nodejs perfectly from here https://docs.npmjs.com/try-the-latest-stable-version-of-npm#upgrading-on-windows
I install AngularJs using the command npm install -g angular-cli and afterwards, when I was trying to create new project, I get the following error,
Cannot find module 'reflect-metadata'
What should I for resolve the error ?
I had to reintall nodeJS from their website and install reflect-metadata and portfinder using the following commands while being as superuser,
sudo npm install -g reflect-metadata
sudo npm install -g portfinder
Afterwards, I can create new project using the command,
ng new myProject
Upgrade npm by npm install -g npm.
If problem still exists try:
npm i -g reflect-metadata
Re-installing node.js worked for me.
I had installation issues of angular-cli on Windows 10 system.
The errors were related to Python dependencies and node-gyp. Something as below :
>execSync#1.0.2 install C:\Users\UserName\AppData\Roaming\npm\node_modules\angular-cli\node_modules\execSync
node install.js
[execsync v1.0.2] Attempting to compile native extensions.
{ Error: spawn node-gyp ENOENT
at exports._errnoException (util.js:1007:11)
Update
this seems to be fixed in newer releases and this solution is no longer required.
mukesh51 eventually solved the problem.
the installation seems to work in these steps:
npm install -g node-gyp
npm install -g windows-build-tools
npm install -g #angular/cli
I took these steps from here.
Uninstall
npm uninstall -g angular-cli
npm uninstall --save-dev angular-cli
Update Global package
npm uninstall -g #angular/cli
npm cache clean
npm install -g #angular/cli#latest
I too faced the same issue initially when I installed angular directly using bash. The installation was error completely. Then I attempted to install locally in my project (without removing the global one). That appeared to have solved the problem but got an error on creating a new app.
So i uninstalled everything :
npm uninstall -g #angular/cli
and the reinstalled Angular using Windows Power Shell(as Admin)
npm install -g #angular/cli
This solved the entire problem! Hope it helps!
Use windows power shell to install angular-cli. It will run without any issues.
Windows 10 Solution
Look back at the trace of installation steps ... you may see that it found the Angular binary in the following location:
C:\Program Files\Git\usr\local\node_modules\#angular\cli\bin
I added an ENVT variable using this path and ng worked fine after that
I tried using npm install -g #angular/cli
npm downloaded files successfully and copied files to AppData but not able to use ng -v
After that, I tried following:
npm cache clean --force
Removes npm cache forcefully if you get warning using npm cache clean.
Then try
npm install -g #angular/cli#latest
I have successfully installed by trying the above solution in Windows10.
Both the CLI and generated project have dependencies that require Node 8.9 or higher, together with NPM 5.5.1 or higher.
try update node.js and npm
npm uninstall -g #angular/cli
npm install -g #angular/cli
if doesn't work:
Close the terminal, open a new one or use CMD or Git for windows instead.
I have installed mean.io and ran sudo npm install. Actually following commands in sequence
sudo npm install -g meanio
mean init yourNewApp
cd yourNewApp
sudo npm install -g bower
sudo npm install
It is supposed to download and install angularjs libraries into public/system/lib. After doing the above steps public /system/lib is not created due to which when I start the application I get the error
events.js:72
throw er; // Unhandled 'error' event
^
Error: ENOENT, open '/home/santhosh/dev/scaleqa/mean_tut/old mean/temp/myapp/public/system/lib/bootstrap/dist/css/bootstrap.css'
[nodemon] app crashed - waiting for file changes before starting...
Is it something to do with certain npm/angularjs server being down. I have faced this problem earlier also but got fixed on 2nd try and I didn't bother to do more research. This became a big issue when I try to pull my repo into cloud and start the application. public/system/lib is added in .gitignore by default and is expected to be created during npm install.
I get following warnings with sudo npm install
npm WARN package.json mean-connect-mongo#0.4.3 No repository field.
npm WARN cannot run in wd mean#0.3.3 node node_modules/bower/bin/bower install (wd=/home/santhosh/dev/scaleqa/mean_tut/old mean/temp/myapp)
this is link to package.json
The problem maybe related to running npm install as sudo, which can cause problems. As mentioned in another stack overflow question, this can be worked around in a couple ways. But because it looks like this is being run from your home directory, you really shouldn't need to run npm install as root.
Try to issue the same commands, but the last without sudo:
sudo npm install -g meanio
mean init yourNewApp
cd yourNewApp
sudo npm install -g bower
npm install
Note that the reason you may need to run npm install -g <package> using sudo is because by default npm uses /usr/local for global installs, which can be a restricted directory. However, when you install a package locally (without the -g flag) you should not need to run as root.