Надеюсь, кто-то может помочь с этим. Я пытался обновить и запустить транспортир из моего терминала в первый раз, и я получил это сообщение об ошибке.
Команда, которую я использовал, была
npm run start
Я посмотрел на свой скрипт package.json, и это выглядит нормально. Я что-то пропустил?
npm.json file
{
"name": "LocatorTraining",
"dependencies": {
"protractor": "^5.4.1"
},
"scripts": {
"webdriver-update": "./node_modules/.bin/webdriver-manager update",
"webdriver-start": "./node_modules/.bin/webdriver-manager start",
"protractor": "./node_modules/.bin/protractor configurations.js",
"start": "npm run webdriver-manager update &&npm run webdriver-manager start"
}
}
Сообщение от терминала
JohnSmith-MacBook-Air:~ JohnSmith$ npm run start
npm ERR! Darwin 17.7.0
npm ERR! argv "/Users/JohnSmith/.nvm/versions/node/v7.2.0/bin/node" "/Users/xx/.nvm/versions/node/v7.2.0/bin/npm" "run" "start"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9
npm ERR! path /Users/JohnSmith/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/JohnSmith/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/Users/JohnSmith/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/JohnSmith/npm-debug.log
Поэтому, следуя комментарию снизу, я попытался запустить npm run start на уровне проекта.
Я получил следующий ответ.
Ran the npm run start from project level> LocatorTraining@ start /Users/JohnSmith/Documents/JSworkspace/LocatorTraining
> npm run webdriver-manager update &&npm run webdriver-manager start
npm ERR! Darwin 17.7.0
npm ERR! argv "/Users/JohnSmith/.nvm/versions/node/v7.2.0/bin/node" "/Users/jacquelinegeorge/.nvm/versions/node/v7.2.0/bin/npm" "run" "webdriver-manager" "update"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9
npm ERR! missing script: webdriver-manager
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/JohnSmith/Documents/JSworkspace/LocatorTraining/npm-debug.log
npm ERR! Darwin 17.7.0
npm ERR! argv "/Users/JohnSmith/.nvm/versions/node/v7.2.0/bin/node" "/Users/jacquelinegeorge/.nvm/versions/node/v7.2.0/bin/npm" "run" "start"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! LocatorTraining@ start: `npm run webdriver-manager update &&npm run webdriver-manager start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the LocatorTraining@ start script 'npm run webdriver-manager update &&npm run webdriver-manager start'.
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 LocatorTraining package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run webdriver-manager update &&npm run webdriver-manager start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs LocatorTraining
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls LocatorTraining
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/JohnSmith/Documents/JSworkspace/LocatorTraining/npm-debug.log
Затем я попытался получить доступ к журналу отладки npm на уровне проекта
/Users/JohnSmith/Documents/JSworkspace/LocatorTraining/npm-debug.log: Permission denied