【发布时间】:2017-05-05 01:46:11
【问题描述】:
我遇到了一些非常奇怪的事情。基本上我正在做一个有角度的项目,我在另一台机器上开始,然后将项目保存在 github 上,今天我将 repo 克隆到另一台机器上,但是当我运行 npm start 时,我收到了一个很好的错误消息:
C:\Users\antobbo\Documents\angularjsProjects\todoList>npm start
> angular-quickstart@1.0.0 start C:\Users\antobbo\Documents\angularjsProjects\todoList
> tsc && concurrently "tsc -w" "lite-server"
node_modules/protractor/built/browser.d.ts(260,37): error TS2503: Cannot find namespace 'webdriver'.
node_modules/protractor/built/browser.d.ts(267,55): error TS2503: Cannot find namespace 'webdriver'.
node_modules/protractor/built/browser.d.ts(267,78): error TS2503: Cannot find namespace 'webdriver'.
node_modules/protractor/built/browser.d.ts(358,31): error TS2503: Cannot find namespace 'webdriver'.
node_modules/protractor/built/browser.d.ts(369,26): error TS2503: Cannot find namespace 'webdriver'.
node_modules/protractor/built/browser.d.ts(425,36): error TS2503: Cannot find namespace 'webdriver'.
node_modules/protractor/built/ptor.d.ts(13,29): error TS2503: Cannot find namespace 'webdriver'.
npm ERR! Windows_NT 10.0.14393
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.2
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart@1.0.0 start: `tsc && concurrently "tsc -w" "lite-server" `
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 start script 'tsc && concurrently "tsc -w" "lite-server" '.
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 && concurrently "tsc -w" "lite-server"
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! C:\Users\antobbo\Documents\angularjsProjects\todoList\npm-debug.log
值得注意的是,我拥有最新版本的 node 和 npm,但我确实使用了角度快速入门,并且在另一台机器上一切正常。 我也有log here 到目前为止,我已经再次卸载并重新安装了节点,但无济于事。是否有人有任何建议,请记住,正如我所说,该应用程序确实可以在我可以启动 npm 并运行它的另一台机器上运行?
编辑:好的,我以为我为像我这样的初学者添加了一个小注释,因为我犯了一个小学生错误。我说我在 package.json 中找不到任何 selenium webdriver,那是因为我已经在我的项目上运行了 nmp install - 你知道我是 Angular2 和 nodejs 的真正初学者 - 所以我完全删除了我的项目,再次克隆 repo,在运行任何其他命令之前查看我的 package.json,在 devDependencies 下找到有问题的行并更改为建议的内容。现在可以使用了
【问题讨论】:
-
您检查了任何已安装的模块吗?
-
我遇到了同样的错误。我没有使用 angular-quickstart,但它是一个使用量角器进行 e2e 测试的 angular 2 项目,这似乎是问题所在。几个月前,当他们将 type defs 从 typings 转移到 npm 时,我也发生了类似的事情。我还没有找到解决办法。