npm WARN saveError ENOENT:没有这样的文件或目录

时间:2018-12-21 07:52:18

标签: node.js npm npm-install

当我尝试运行npm install时,出现以下错误。

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

audited 15434 packages in 3.37s
found 1227 vulnerabilities (185 low, 326 moderate, 716 high)
  run `npm audit fix` to fix them, or `npm audit` for details

我的主题文件结构如下

template/
   |-- package.json
   |-- GruntFile.js
   |-- assets/
   |   |-- css/
   |   |-- img/
   |   |-- js/
   |   |-- scss/
   |-- libs/
   |   |-- jquery/
   |   |-- bootstrap/
   |   |-- ...
   |-- docs/
   |   |-- index.html
   |   |-- build.html
   |   |-- ...
   |-- html/
   |   |-- dashboard.html
   |   |-- app.user.html
   |   |-- ...

现在确定为什么要尝试从我的用户目录访问package.json。当我尝试从模板目录内部运行命令时。

这是审核日志:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'audit' ]
2 info using npm@6.4.1
3 info using node@v10.14.2
4 verbose config Skipping project config: /Users/harshamv/.npmrc. (matches userconfig)
5 verbose npm-session 1bbf94576e91f043
6 verbose stack Error: No package.json found: Cannot audit a project without a package.json
6 verbose stack     at Bluebird.all.spread (/usr/local/lib/node_modules/npm/lib/audit.js:143:19)
6 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
6 verbose stack     at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:509:35)
6 verbose stack     at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
6 verbose stack     at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
6 verbose stack     at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
6 verbose stack     at Promise._fulfill (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
6 verbose stack     at PromiseArray._resolve (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise_array.js:126:19)
6 verbose stack     at PromiseArray._promiseFulfilled (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise_array.js:144:14)
6 verbose stack     at PromiseArray._iterate (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise_array.js:114:31)
6 verbose stack     at PromiseArray.init [as _init] (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise_array.js:78:10)
6 verbose stack     at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:566:21)
6 verbose stack     at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
6 verbose stack     at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
6 verbose stack     at Promise._fulfill (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
6 verbose stack     at PromiseArray._resolve (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise_array.js:126:19)
7 verbose cwd /Users/harshamv/Sites/template
8 verbose Darwin 18.2.0
9 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "audit"
10 verbose node v10.14.2
11 verbose npm  v6.4.1
12 error code EAUDITNOPJSON
13 error audit No package.json found: Cannot audit a project without a package.json
14 verbose exit [ 1, true ]

0 个答案:

没有答案