尝试使用主题公园GitHub存储库时,NPM测试错误,代码为ELIFECYCLE错误

时间:2019-03-02 21:49:30

标签: github npm babel

我正在从GitHub上创建的API收集数据。我按照自述文件要求进行测试,但我不断收到这些错误:

/usr/bin/node_modules/themeparks$ npm test
> themeparks@4.7.11 test /usr/bin/node_modules/themeparks
> npm run build && node_modules/.bin/mocha dist/test.js
> themeparks@4.7.11 build /usr/bin/node_modules/themeparks
> babel lib --presets es2015,stage-0 --out-dir dist --source-maps
sh: 1: babel: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! themeparks@4.7.11 build: `babel lib --presets es2015,stage-0 --out-dir dist --source-maps
`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the themeparks@4.7.11 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myaccount/.npm/_logs/2019-03-02T21_22_28_684Z-debug.log
npm ERR! Test failed.  See above for more details.

安装babel后(sudo npm install --save-dev @ babel / cor e @ babel / cli),这是新的输出:

/usr/bin/node_modules/themeparks$ npm test
> themeparks@4.7.11 test /usr/bin/node_modules/themeparks
> npm run build && node_modules/.bin/mocha dist/test.js
> themeparks@4.7.11 build /usr/bin/node_modules/themeparks
> babel lib --presets es2015,stage-0 --out-dir dist --source-maps
{ Error: Cannot find module 'babel-preset-es2015' from '/usr/bin/node_modules/themeparks'
    at Function.module.exports [as sync] (/usr/bin/node_modules/themeparks/node_modules/resolve/li
b/sync.js:58:15)
    at resolveStandardizedName (/usr/bin/node_modules/themeparks/node_modules/@babel/core/lib/conf
ig/files/plugins.js:101:31)
    at resolvePreset (/usr/bin/node_modules/themeparks/node_modules/@babel/core/lib/config/files/p
lugins.js:58:10)
    at loadPreset (/usr/bin/node_modules/themeparks/node_modules/@babel/core/lib/config/files/plug
ins.js:77:20)
    at createDescriptor (/usr/bin/node_modules/themeparks/node_modules/@babel/core/lib/config/conf
ig-descriptors.js:154:9)
    at items.map (/usr/bin/node_modules/themeparks/node_modules/@babel/core/lib/config/config-desc
riptors.js:109:50)
    at Array.map (<anonymous>)
    at createDescriptors (/usr/bin/node_modules/themeparks/node_modules/@babel/core/lib/config/con
fig-descriptors.js:109:29)
    at createPresetDescriptors (/usr/bin/node_modules/themeparks/node_modules/@babel/core/lib/conf
ig/config-descriptors.js:101:10)
    at passPerPreset (/usr/bin/node_modules/themeparks/node_modules/@babel/core/lib/config/config-
descriptors.js:58:96) code: 'MODULE_NOT_FOUND' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! themeparks@4.7.11 build: `babel lib --presets es2015,stage-0 --out-dir dist --source-maps
`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the themeparks@4.7.11 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myaccount/.npm/_logs/2019-03-02T21_37_13_905Z-debug.log
npm ERR! Test failed.  See above for more details.

这里是GitHub to the API I am trying to use

0 个答案:

没有答案