Jhipster npm安装失败,出现“错误”;npm错误!无法读取属性';原始和#x27;“未定义”的定义;当使用我自己的蓝图时

Jhipster npm安装失败,出现“错误”;npm错误!无法读取属性';原始和#x27;“未定义”的定义;当使用我自己的蓝图时,jhipster,Jhipster,我已经创建了自己的蓝图,我正在尝试将其与JHipster的本地版本一起使用(遵循此处的规则:) 但是,在运行npm安装时,我得到: npm WARN tar ENOENT: no such file or directory, open '/my_project/node_modules/.staging/minimist-19b0b9f9/package.json' npm WARN tar ENOENT: no such file or directory, open '/my_projec

我已经创建了自己的蓝图,我正在尝试将其与JHipster的本地版本一起使用(遵循此处的规则:)

但是,在运行npm安装时,我得到:

npm WARN tar ENOENT: no such file or directory, open '/my_project/node_modules/.staging/minimist-19b0b9f9/package.json'
npm WARN tar ENOENT: no such file or directory, open '/my_project/node_modules/.staging/p-limit-6a9bed74/license'
npm WARN tar ENOENT: no such file or directory, open '/my_project/node_modules/.staging/minimist-19b0b9f9/LICENSE'
npm WARN tar ENOENT: no such file or directory, open '/my_project/node_modules/.staging/p-limit-6a9bed74/index.js'
npm WARN tar ENOENT: no such file or directory, open '/my_project/node_modules/.staging/minimist-19b0b9f9/index.js'
(这种情况持续了100多行)

日志记录以以下内容结束:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: yeoman-test@2.2.0 (node_modules/generator-jhipster/node_modules/yeoman-test):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: yeoman-assert@3.1.1 (node_modules/generator-jhipster/node_modules/yeoman-assert):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sinon@7.2.5 (node_modules/generator-jhipster/node_modules/sinon):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: mocha@6.1.4 (node_modules/generator-jhipster/node_modules/mocha):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: jsdoc@3.6.3 (node_modules/generator-jhipster/node_modules/jsdoc):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: eslint-plugin-prettier@3.1.0 (node_modules/generator-jhipster/node_modules/eslint-plugin-prettier):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: eslint-plugin-import@2.18.2 (node_modules/generator-jhipster/node_modules/eslint-plugin-import):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: eslint-config-prettier@6.1.0 (node_modules/generator-jhipster/node_modules/eslint-config-prettier):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: eslint-config-airbnb-base@14.0.0 (node_modules/generator-jhipster/node_modules/eslint-config-airbnb-base):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: eslint@6.2.2 (node_modules/generator-jhipster/node_modules/eslint):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ejs-lint@0.3.0 (node_modules/generator-jhipster/node_modules/ejs-lint):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: chai@4.2.0 (node_modules/generator-jhipster/node_modules/chai):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @openapitools/openapi-generator-cli@1.0.10-4.2.3 (node_modules/generator-jhipster/node_modules/@openapitools/openapi-generator-cli):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Cannot read property 'raw' of undefined

npm ERR! Cannot read property 'raw' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2020-03-11T04_43_33_553Z-debug.log
我在日志中看到:

38893 verbose stack TypeError: Cannot read property 'raw' of undefined
38893 verbose stack     at /usr/local/lib/node_modules/npm/lib/install/action/extract.js:67:20
38893 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
38893 verbose stack     at Function.Promise.fromNode.Promise.fromCallback (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:185:30)
38893 verbose stack     at extract (/usr/local/lib/node_modules/npm/lib/install/action/extract.js:63:13)
38893 verbose stack     at /usr/local/lib/node_modules/npm/lib/install/actions.js:75:20
38893 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
38893 verbose stack     at Function.Promise.fromNode.Promise.fromCallback (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:185:30)
38893 verbose stack     at runAction (/usr/local/lib/node_modules/npm/lib/install/actions.js:74:13)
38893 verbose stack     at /usr/local/lib/node_modules/npm/lib/install/actions.js:54:16
38893 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
38893 verbose stack     at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:517:31)
38893 verbose stack     at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:574:18)
38893 verbose stack     at Promise._settlePromiseCtx (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:611:10)
38893 verbose stack     at _drainQueueStep (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:142:12)
38893 verbose stack     at _drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)
38893 verbose stack     at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5)
使用的版本:

  • 节点:v12.16.1

  • npm:v6.13.4

任何帮助都将不胜感激


谢谢。

我遇到了节点>=12.16.1的相同问题。我找不到解决方案,因此在本地进行了更改并继续。不确定相同的选项是否适合您。故障出现在extract.js文件(/usr/local/lib/node_modules/npm/lib/install/action/extract.js)中。在提取方法中,通过添加
spec==未定义
在指定spec.raw或spec.type之前检查,可以绕过问题故障<代码>参数[0]=规格!==未定义?spec.raw:“和
如果(启用\u WORKERS&&spec!==未定义的&&(isRegistry(spec)| | spec.type==='remote')){