I want to install the bcrypt package and im using the "npm install bcrypt --python=python2" and i can this after i run it:
bcrypt#5.0.0 install C:\Users\User\node_modules\bcrypt
node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
[bcrypt] Success: "C:\Users\User\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node" is installed via remote
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\User\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\User\package.json'
npm WARN User No description
npm WARN User No repository field.
npm WARN User No README data
npm WARN User No license field.
+ bcrypt#5.0.0
updated 1 package and audited 130 packages in 2.951s
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
I don't get any module in atom.
This is an error that tells you that current folder you are working in does not have a node project set up, its missing the necessary package.json file (every node project has one and needs one).
There are 2 types of "install" with npm, first is global that that you mark with -g flag (npm install bcrypt -g), this will install whatever package into global node modules that can be executed from the node command line, the second one is installing / adding it to your project.
In order to add anything to your project you need to create your project, create a folder for your project, open cmd line and navigate to the folder, and run npm init, this will create a package.json file (after you answer few questions), then npm install whatever will add the package automatically to the package.json file. (there is also a --save-dev flag that adds node module to dev dependencies)
I wanted to install the Mysql into my node.js project. I tried to install it using these commands
npm install mysqljs/mysql
npm install mysql
but I got the following error
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\cbshr\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\cbshr\package.json'
npm WARN cbshr No description
npm WARN cbshr No repository field.
npm WARN cbshr No README data
npm WARN cbshr No license field.
npm install mysqljs/mysql
npm install mysql
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\cbshr\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\cbshr\package.json'
npm WARN cbshr No description
npm WARN cbshr No repository field.
npm WARN cbshr No README data
npm WARN cbshr No license field.
You need to run your terminal from the folder that contains your project. Based on the message, the terminal is running from C:\Users\cbshr\.
In Windows, shift-rightclick in the folder and choose "Open Command Window Here' or use the cd command to navigate to the folder containing your project.
with the latest version of npm but i cant install compiler successfully.
ash#ubuntu:~/inbox$ node -v
v8.11.1
ash#ubuntu:~/inbox$ npm -v
5.8.0
ash#ubuntu:~/inbox$ sudo npm install --save solc
npm WARN saveError ENOENT: no such file or directory, open '/home/ash/inbox/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/ash/inbox/package.json'
npm WARN webpack-cli#2.0.14 requires a peer of webpack#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN inbox No description
npm WARN inbox No repository field.
npm WARN inbox No README data
npm WARN inbox No license field.
+ solc#0.4.21
updated 1 package in 5.593s
ash#ubuntu:~/inbox$
enter image description here
You're attempting to install into a project directory which will try to update the project's package.json file to add the dependency. The install still worked. You will find it under node_modules/solc.
The better approach is to install it globally:
npm install -g solc
I am having issues installing Cordova and Ionic.
At first I couldn't because of what seems to be a corrupted installation, that led me to uninstall NodeJS - Cordova - Ionic.
Now, I've reinstalled NodeJS, without issues but when it comes to the famous line :
npm install -g cordova ionic, I've got this error :
npm ERR! write after end
then everytime I try to install cordova ionic, I've got the same error for a different package ... Here are errors I get :
C:\Windows\System32>npm install -g cordova ionic
npm ERR! write after end
npm ERR! A complete log of this run can be found in:
npm ERR! d:\Profiles\cjolliet\AppData\Roaming\npm-cache\_logs\2018-03-07T09_31_22_439Z-debug.log
C:\Windows\System32>npm install -g cordova ionic
npm ERR! code ETARGET
npm ERR! notarget No matching version found for ansi-styles#^3.2.1
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'chalk'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! d:\Profiles\cjolliet\AppData\Roaming\npm-cache\_logs\2018-03-07T09_40_04_399Z-debug.log
C:\Windows\System32>
C:\Windows\System32>npm install -g cordova ionic
npm ERR! code ETARGET
npm ERR! notarget No matching version found for supports-color#^5.3.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'chalk'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! d:\Profiles\cjolliet\AppData\Roaming\npm-cache\_logs\2018-03-07T09_44_05_319Z-debug.log
If any of you can help me, it would be very appreciate ;-) Have a nice day...
EDIT 1 : after installing some packages and trying again, I've got this now :
npm install -g cordova ionic
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\path-is-absolute-86a430cb\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parseurl-f42ab09d\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\path-is-absolute-86a430cb\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\opn-07c4c2dd\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\os-tmpdir-c1eaefc0\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parse-glob-106d32b7\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parseurl-f42ab09d\README.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\path-is-absolute-86a430cb\license'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\opn-07c4c2dd\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\os-tmpdir-c1eaefc0\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parse-glob-106d32b7\README.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parseurl-f42ab09d\LICENSE'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\superagent-4d7c9590\lib\agent-base.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\path-is-absolute-86a430cb\readme.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\os-tmpdir-c1eaefc0\license'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\opn-07c4c2dd\license'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parse-glob-106d32b7\LICENSE'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parseurl-f42ab09d\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\superagent-4d7c9590\lib\client.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\opn-07c4c2dd\readme.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\os-tmpdir-c1eaefc0\readme.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parse-glob-106d32b7\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parseurl-f42ab09d\HISTORY.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\opn-07c4c2dd\xdg-open'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\inquirer-b71d51ab\lib\utils\events.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\inquirer-b71d51ab\lib\utils\paginator.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\inquirer-b71d51ab\lib\utils\readline.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\inquirer-b71d51ab\lib\utils\screen-manager.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\readdirp-34d428ea\test\bed\root_dir2\root_dir2_file1.ext1'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\inquirer-b71d51ab\lib\utils\utils.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\readdirp-34d428ea\test\bed\root_dir2\root_dir2_file2.ext2'
npm WARN tar ENOENT: no such file or directory, lstat 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\cordova-lib-a64e9936\src\cordova\metadata'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\qs-095a6ca4\lib\formats.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\qs-095a6ca4\lib\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\qs-095a6ca4\lib\parse.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\qs-095a6ca4\lib\stringify.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\qs-095a6ca4\lib\utils.js'
npm WARN tar ENOENT: no such file or directory, lstat 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\cordova-app-hello-world-60bb7e30\template_src\res\icon\blackberry10'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\tiny-lr-cf15ff1c\src\client.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\tiny-lr-cf15ff1c\src\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\tiny-lr-cf15ff1c\src\server.js'
npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting readable-stream#^2.0.5:
npm ERR! sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ== integrity checksum failed when using sha512: wanted sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ== but got sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==. (25689 bytes)
Try installing latest npm version this happens a lot with ionic.
npm install -g npm#latest
npm cache verify
npm i
If this doesn't work I advise you to switch to yarn. It's faster & easier to use. This is the link to download YARN.
After installing just run this command yarn global add cordova ionic
Ionic CLI uses npm by default. So go to your project & run $ yarn install.
If you want Ionic to use yarn by default run this: $ ionic config set -g yarn true
In my case, I didn't downgrade my npm because it will cause chaos in other dependencies. Instead, I tried running
npm cache verify
Error gone...
Let, update the latest version of npm for running this command,
npm install npm#latest -g
Then run this command,
npm install -g cordova ionic
It happened to me when I tried to install a ionic3 project with npm#5.8, well I solved this issue just add some params, use the following:
npm i --unsafe-perm
and it works.
This still happens randomly on some npm versions. Issue got resolved on downgrading to npm version 5.6.0 using command
npm install -g npm#5.6.0
Hope that will help someone.
Update July 28, 2018
This problem is related to npm version 5.7.1
Upgrading to node version 8.11.3 with npm version 5.8.0 solve the problem
i faced the same issue. For my case, i update npm to latest 6.1.0 by running "npm install -g npm#latest". Then run "npm cache verify
Just run
npm cache verify
This will clean it all.
Usually this error is due to your Antivirus blocking access to changing the files, to solve this:
1- You can try to turn your Antivirus off (temporarily) & try the installation again
2- If that alone doesn't work, try using the --force option while installing
I had this issue with some packages & it was solved by using one of the 2 steps above.
For example:
npm install -g cordova ionic --force
None of the previous answers could help me.
Fortunately, after a lot of 'try and error', I found the following simple solution:
delete (or move) the file 'package-lock.json' and npm install works
flawlessly.
Tip: if you have your project in a git repository:
add the file 'package-lock.json' in '.gitignore'
I was trying to install jquery through npm but after using following command:
npm install jquery
I opened the destination folder and the folder was empty.
(I copied the following text from cmd)
> C:\Users\mandar\Desktop\Mady>npm install jquery
C:\Users\mandar
`-- jquery#3.1.1
> npm WARN enoent ENOENT: no such file or directory, open
> 'C:\Users\mandar\package.json'
npm WARN mandar No description
npm WARN mandar No repository field.
npm WARN mandar No README data
npm WARN mandar No license field.
What am I doing wrong? Please help me
You don't have a package.json. Create a one and then try to install jQuery. And instead use
npm install jquery --save
command to save the jquery dependency in the package.json file
You can do it manually creating package.json or by
npm init and passing the steps
create package.json file manually or through cmd by command npm init or npm install jquery --save
As Suren Srapyan mentioned, in order to solve the problem, you need to create a package.json file, which describes the project you're working on.
The easiest way to create a package.json file is to run npm init - this will invoke a terminal-based walkthrough of creating the package.json file.