当我尝试在Webstorm中运行运行和调试设置时出现以下错误-
> "C:\Program Files (x86)\JetBrains\WebStorm 8.0.1\bin\runnerw.exe"
> "C:\Program Files\nodejs\node.exe" node_modules\protractor\lib\cli.js
> C:\WebstormWorkspace\Protractor\config\protractorConfig.js
>
> module.js:340
> throw err;
> ^ Error: Cannot find module 'lodash'
> at Function.Module._resolveFilename (module.js:338:15)
> at Function.Module._load (module.js:280:25)
> at Module.require (module.js:364:17)
> at require (module.js:380:17)
> at Object.<anonymous> (C:\WebstormWorkspace\Protractor\node_modules\protractor\lib\configParser.js:4:9)
> at Module._compile (module.js:456:26)
> at Object.Module._extensions..js (module.js:474:10)
> at Module.load (module.js:356:32)
> at Function.Module._load (module.js:312:12)
> at Module.require (module.js:364:17)
>
> Process finished with exit code 8
我已经在全球范围内安装了量角器,并且安装了以下软件包-
C:\WebstormWorkspace\Protractor>npm install -g protractor
npm http GET https://registry.npmjs.org/protractor
npm http 304 https://registry.npmjs.org/protractor
npm http GET https://registry.npmjs.org/selenium-webdriver/2.41.0
npm http GET https://registry.npmjs.org/minijasminenode/0.4.0
npm http GET https://registry.npmjs.org/saucelabs
npm http GET https://registry.npmjs.org/adm-zip/0.4.4
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/q/1.0.0
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/adm-zip/0.4.4
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/selenium-webdriver/2.41.0
npm http 304 https://registry.npmjs.org/saucelabs
npm http 304 https://registry.npmjs.org/minijasminenode/0.4.0
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/q/1.0.0
npm http 304 https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/minimist
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/minimist
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/lru-cache
C:\Users\pjajoo\AppData\Roaming\npm\webdriver-manager -> C:\Users\pjajoo\AppData\Roaming\npm\node_modules\protractor\bin\webdriver-manager
C:\Users\pjajoo\AppData\Roaming\npm\protractor -> C:\Users\pjajoo\AppData\Roaming\npm\node_modules\protractor\bin\protractor
[email protected] C:\Users\pjajoo\AppData\Roaming\npm\node_modules\protractor
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected]
C:\WebstormWorkspace\Protractor>
谁能帮我为什么我不能在webstorm中运行它?
最佳答案
您已在全球范围内安装了量角器,则必须将Webstorm运行配置中脚本的路径更改为全局路径。
关于javascript - 找不到模块“lodash”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23285630/