使用angular2-seed的angular2项目“无法找到模块”错误

时间:2016-08-26 01:12:43

标签: angular sass

我刚刚升级到最新且最好的,并根据https://github.com/mgechev/angular2-seed/wiki/Enabling-SASS-support

添加了SASS集成

但是,当我运行npm start时,我收到了大量错误:

 [18:07:51] 'build.html_css' errored after 624 ms
[18:07:51] Error: Cannot find module 'reflect-metadata/Reflect.js'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.require.resolve (module.js:389:19)
    at /Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:506:59
    at Array.forEach (native)
    at normalizeDependencies (/Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:506:6)
    at ProjectConfig.Object.defineProperty.get [as DEPENDENCIES] (/Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:301:12)
    at getExternalCss (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:124:10)
    at getExternalCssStream (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:116:19)
    at processAllExternalStylesheets (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:104:16)
    at processExternalStylesheets (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:96:24)
[18:07:51] 'serve.dev' errored after 831 ms
[18:07:51] Error in plugin 'run-sequence(build.html_css)'
Message:
    Cannot find module 'reflect-metadata/Reflect.js'
Details:
    code: MODULE_NOT_FOUND
Stack:
Error: Cannot find module 'reflect-metadata/Reflect.js'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.require.resolve (module.js:389:19)
    at /Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:506:59
    at Array.forEach (native)
    at normalizeDependencies (/Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:506:6)
    at ProjectConfig.Object.defineProperty.get [as DEPENDENCIES] (/Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:301:12)
    at getExternalCss (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:124:10)
    at getExternalCssStream (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:116:19)
    at processAllExternalStylesheets (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:104:16)
    at processExternalStylesheets (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:96:24)
[18:07:51] 'build.dev' errored after 832 ms
[18:07:51] Error in plugin 'run-sequence(serve.dev)'
Message:
    Cannot find module 'reflect-metadata/Reflect.js'
Details:
    code: MODULE_NOT_FOUND
Stack:
Error: Cannot find module 'reflect-metadata/Reflect.js'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.require.resolve (module.js:389:19)
    at /Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:506:59
    at Array.forEach (native)
    at normalizeDependencies (/Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:506:6)
    at ProjectConfig.Object.defineProperty.get [as DEPENDENCIES] (/Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:301:12)
    at getExternalCss (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:124:10)
    at getExternalCssStream (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:116:19)
    at processAllExternalStylesheets (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:104:16)
    at processExternalStylesheets (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:96:24)
[18:07:51] 'build.dev' errored after 832 ms
[18:07:51] Error in plugin 'run-sequence(build.html_css)'
Message:
    Cannot find module 'reflect-metadata/Reflect.js'
Details:
    code: MODULE_NOT_FOUND
Stack:
Error: Cannot find module 'reflect-metadata/Reflect.js'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.require.resolve (module.js:389:19)
    at /Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:506:59
    at Array.forEach (native)
    at normalizeDependencies (/Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:506:6)
    at ProjectConfig.Object.defineProperty.get [as DEPENDENCIES] (/Users/ShurikAg/Dev/angular2/priz-fe/tools/config/seed.config.ts:301:12)
    at getExternalCss (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:124:10)
    at getExternalCssStream (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:116:19)
    at processAllExternalStylesheets (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:104:16)
    at processExternalStylesheets (/Users/ShurikAg/Dev/angular2/priz-fe/tools/tasks/seed/build.html_css.ts:96:24)

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.0.0
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! angular2-seed@0.0.0 start: `gulp serve.dev --color`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-seed@0.0.0 start script 'gulp serve.dev --color'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp serve.dev --color
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2-seed
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular2-seed
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ShurikAg/Dev/angular2/priz-fe/npm-debug.log

我不确定从哪里开始寻找问题。 任何想法都会非常有用。

谢谢,

1 个答案:

答案 0 :(得分:0)

最终我通过添加" reflect-metadata":" ^ 0.1.8"来解决它。进入项目。