【问题标题】:npm cannot start on servernpm 无法在服务器上启动
【发布时间】:2016-11-05 03:40:22
【问题描述】:

我已经创建了我的第一个 Angular2 应用程序,我想将它部署在服务器上。在我的开发平台上,应用程序运行良好(Windows 上的 Pycharm),当我在服务器上运行应用程序时,出现以下错误。我不知道出了什么问题?代码可以在https://github.com/DamenShipyards/DatabaseChecksFrontend找到

C:\DatabaseChecksFrontend>npm start

> DatabaseChecksFrontend@1.0.0 start C:\DatabaseChecksFrontend
> tsc && concurrently "npm run tsc:w" "npm run lite"

app/app.module.ts(8,30): error TS2307: Cannot find module './check.component'.
app/app.module.ts(9,31): error TS2307: Cannot find module './groups.component'.
app/app.module.ts(10,29): error TS2307: Cannot find module './grid.component'.
app/app.module.ts(11,38): error TS2307: Cannot find module './highlightcode.dire
ctive'.

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.0
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! DatabaseChecksFrontend@1.0.0 start: `tsc && concurrently "npm run tsc:w
" "npm run lite" `
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the DatabaseChecksFrontend@1.0.0 start script 'tsc && concurr
ently "npm run tsc:w" "npm run lite" '.
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 DatabaseChecksFronten
d package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsc && concurrently "npm run tsc:w" "npm run lite"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs DatabaseChecksFrontend
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls DatabaseChecksFrontend
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\DatabaseChecksFrontend\npm-debug.log

【问题讨论】:

    标签: node.js angular typescript npm


    【解决方案1】:

    可能是因为您在没有sudo 权限的情况下运行 npm。您可以在 npm 的以下官方文档中阅读有关此问题的更多信息:npm permission issue

    【讨论】:

    • sudo 是最好的
    【解决方案2】:

    您的应用文件夹中没有名为./check.component.ts./groups.component.ts./grid.component.ts./highlightcode.directive.ts 的文件。您只能从实际存在的模块中导入某些内容。

    也许它适用于您的开发,因为您有一个脏文件夹。在其他地方克隆同一个存储库并尝试再次运行它,它应该会失败。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-22
      • 1970-01-01
      • 2016-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-24
      相关资源
      最近更新 更多