nodejs安装模块报错


C:\Users\Administrator>npm install crypto-js --save
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\Administrat
or\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Administrator\
package.json'
npm WARN Administrator No description
npm WARN Administrator No repository field.
npm WARN Administrator No README data
npm WARN Administrator No license field.

+ crypto-js@4.0.0
added 1 package from 1 contributor and audited 1 package in 2.861s
found 0 vulnerabilities
阅读 3.3k
3 个回答

当你使用npm安装包的时候
最好目录下有 package.json 文件,
如果没有, 你可以用 npm init 生成 package.json

上面警告是说没有找到 package.json 文件,
他将自动创建一个 package.json

宣传栏