我使用角度quickstart作为基础构建了一个应用程序,并将其升级为angular4。
当我npm start
本地编译时没有问题,但是当我在服务器上执行相同操作时,它不会编译,也找不到我创建的任何模块。
> npm start
> angular-quickstart@1.0.0 prestart /var/www/html/path
> npm run build
> angular-quickstart@1.0.0 build /var/www/html/path
> tsc -p src/
src/app/Global/global.ts(1,31): error TS2307: Cannot find module './../library/data.processor'.
src/app/Home/home.module.ts(8,31): error TS2307: Cannot find module './components/home.component'.
src/app/Navbar/Components/navbar.component.ts(5,33): error TS2307: Cannot find module './../../global/global'.
src/app/Navbar/navbar.module.ts(9,33): error TS2307: Cannot find module './components/navbar.component'.
src/app/Profile/Components/facebook-profile.component.ts(6,32): error TS2307: Cannot find module './../../library/chart.processor'.
src/app/Profile/Components/facebook-profile.component.ts(7,31): error TS2307: Cannot find module './../../library/data.processor'.
src/app/Profile/Components/facebook-profile.component.ts(10,33): error TS2307: Cannot find module '../model/facebook-profile'.
src/app/Profile/Components/facebook-profile.component.ts(11,22): error TS2307: Cannot find module '../model/like'.
src/app/Profile/Components/facebook-profile.component.ts(12,35): error TS2307: Cannot find module '../model/talking-about-count'.
src/app/Profile/Components/facebook-profile.component.ts(13,32): error TS2307: Cannot find module '../model/post-engagement'.
src/app/Profile/Components/facebook-profile.component.ts(16,40): error TS2307: Cannot find module '../services/facebook-profile.service'.
src/app/Profile/Components/facebook-top-profile-list.component.ts(6,36): error TS2307: Cannot find module '../model/facebook-top-profile'.
src/app/Profile/Components/facebook-top-profile-list.component.ts(7,21): error TS2307: Cannot find module '../model/tag'.
src/app/Profile/Components/facebook-top-profile-list.component.ts(9,40): error TS2307: Cannot find module '../services/facebook-profile.service'.
src/app/Profile/Components/facebook-top-profile-list.component.ts(10,28): error TS2307: Cannot find module '../services/tag.service'.
src/app/Profile/Components/twitter-profile.component.ts(6,32): error TS2307: Cannot find module './../../library/chart.processor'.
src/app/Profile/Components/twitter-profile.component.ts(7,31): error TS2307: Cannot find module './../../library/data.processor'.
src/app/Profile/Components/twitter-profile.component.ts(10,32): error TS2307: Cannot find module '../model/twitter-profile'.
src/app/Profile/Components/twitter-profile.component.ts(11,32): error TS2307: Cannot find module '../model/followers-count'.
src/app/Profile/Components/twitter-profile.component.ts(12,31): error TS2307: Cannot find module '../model/statuses-count'.
src/app/Profile/Components/twitter-profile.component.ts(13,32): error TS2307: Cannot find module '../model/post-engagement'.
src/app/Profile/Components/twitter-profile.component.ts(16,39): error TS2307: Cannot find module '../services/twitter-profile.service'.
src/app/Profile/Components/twitter-top-profile-list.component.ts(6,35): error TS2307: Cannot find module '../model/twitter-top-profile'.
src/app/Profile/Components/twitter-top-profile-list.component.ts(7,21): error TS2307: Cannot find module '../model/tag'.
src/app/Profile/Components/twitter-top-profile-list.component.ts(9,39): error TS2307: Cannot find module '../services/twitter-profile.service'.
src/app/Profile/Components/twitter-top-profile-list.component.ts(10,28): error TS2307: Cannot find module '../services/tag.service'.
src/app/Profile/Services/facebook-profile.service.ts(5,33): error TS2307: Cannot find module '../model/facebook-profile'.
src/app/Profile/Services/facebook-profile.service.ts(6,22): error TS2307: Cannot find module '../model/like'.
src/app/Profile/Services/facebook-profile.service.ts(7,35): error TS2307: Cannot find module '../model/talking-about-count'.
src/app/Profile/Services/facebook-profile.service.ts(8,32): error TS2307: Cannot find module '../model/post-engagement'.
src/app/Profile/Services/facebook-profile.service.ts(9,36): error TS2307: Cannot find module '../model/facebook-top-profile'.
src/app/Profile/Services/facebook-profile.service.ts(11,33): error TS2307: Cannot find module './../../global/global'.
src/app/Profile/Services/tag.service.ts(4,31): error TS2307: Cannot find module '../model/tag'.
src/app/Profile/Services/tag.service.ts(6,33): error TS2307: Cannot find module './../../global/global'.
src/app/Profile/Services/twitter-profile.service.ts(5,32): error TS2307: Cannot find module '../model/twitter-profile'.
src/app/Profile/Services/twitter-profile.service.ts(6,32): error TS2307: Cannot find module '../model/followers-count'.
src/app/Profile/Services/twitter-profile.service.ts(7,31): error TS2307: Cannot find module '../model/statuses-count'.
src/app/Profile/Services/twitter-profile.service.ts(8,32): error TS2307: Cannot find module '../model/post-engagement'.
src/app/Profile/Services/twitter-profile.service.ts(9,35): error TS2307: Cannot find module '../model/twitter-top-profile'.
src/app/Profile/Services/twitter-profile.service.ts(11,33): error TS2307: Cannot find module './../../global/global'.
src/app/Profile/profile.module.ts(8,42): error TS2307: Cannot find module './components/facebook-profile.component'.
src/app/Profile/profile.module.ts(9,49): error TS2307: Cannot find module './components/facebook-top-profile-list.component'.
src/app/Profile/profile.module.ts(11,41): error TS2307: Cannot find module './components/twitter-profile.component'.
src/app/Profile/profile.module.ts(12,48): error TS2307: Cannot find module './components/twitter-top-profile-list.component'.
src/app/Profile/profile.module.ts(14,40): error TS2307: Cannot find module './services/facebook-profile.service'.
src/app/Profile/profile.module.ts(15,39): error TS2307: Cannot find module './services/twitter-profile.service'.
src/app/Profile/profile.module.ts(16,28): error TS2307: Cannot find module './services/tag.service'.
src/app/app-routing.module.ts(4,31): error TS2307: Cannot find module './home/components/home.component'.
src/app/app-routing.module.ts(6,49): error TS2307: Cannot find module './profile/components/facebook-top-profile-list.component'.
src/app/app-routing.module.ts(7,42): error TS2307: Cannot find module './profile/components/facebook-profile.component'.
src/app/app-routing.module.ts(8,48): error TS2307: Cannot find module './profile/components/twitter-top-profile-list.component'.
src/app/app-routing.module.ts(9,41): error TS2307: Cannot find module './profile/components/twitter-profile.component'.
src/app/app.module.ts(8,31): error TS2307: Cannot find module './profile/profile.module'.
src/app/app.module.ts(9,28): error TS2307: Cannot find module './home/home.module'.
src/app/app.module.ts(10,30): error TS2307: Cannot find module './navbar/navbar.module'.
npm ERR! Linux 4.9.7-x86_64-linode80
npm ERR! argv "/root/.nvm/versions/node/v6.10.2/bin/node" "/root/.nvm/versions/node/v6.10.2/bin/npm" "run" "build"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart@1.0.0 build: `tsc -p src/`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 build script 'tsc -p src/'.
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 angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc -p src/
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/unify/frontend/insights/npm-debug.log
npm ERR! Linux 4.9.7-x86_64-linode80
npm ERR! argv "/root/.nvm/versions/node/v6.10.2/bin/node" "/root/.nvm/versions/node/v6.10.2/bin/npm" "start"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart@1.0.0 prestart: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 prestart script 'npm run build'.
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 angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/unify/frontend/insights/npm-debug.log
我正在跑步:
> tsc -v
Version 2.2.2
> node -v
v6.10.2
> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
> apache2 -v
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2016-07-14T12:32:26
我尝试过更改文件权限,但仍会导致同样的问题。