@Artem0071
Безработный mr. Junior

Почему не удаётся собрать фронтенд в новом проекте на Laravel?

До этого только установил laravel через laravel new
В проект перешел
Зависимости установил так: npm install
Пытаюсь запустить npm run watch

Но выдает следующее:
MBP-Artem-2:Cibus artemdegtarev$ npm run watch

> @ watch /Users/artemdegtarev/Desktop/projects/WEB/Cibus
> npm run development -- --watch --watch-poll


> @ development /Users/artemdegtarev/Desktop/projects/WEB/Cibus
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"

 
Additional dependencies must be installed. This will only take a moment.

Running: yarn add vue-template-compiler --dev --production=false
/bin/sh: yarn: command not found
/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/webpack-cli/bin/cli.js:244
                                throw err;
                                ^

Error: Command failed: yarn add vue-template-compiler --dev --production=false
/bin/sh: yarn: command not found

    at checkExecSyncError (child_process.js:602:13)
    at Object.execSync (child_process.js:642:13)
    at Dependencies.execute (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/Dependencies.js:52:22)
    at dependencies.reject.tap.dependencies (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/Dependencies.js:30:22)
    at Array.value (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/helpers.js:24:13)
    at Dependencies.install (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/Dependencies.js:29:14)
    at Function.dependencies (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/Assert.js:77:40)
    at concat.filter.tap.dependencies (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/components/ComponentFactory.js:130:24)
    at Array.value (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/helpers.js:24:13)
    at ComponentFactory.installDependencies (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/components/ComponentFactory.js:129:14)
    at Mix.listen (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/components/ComponentFactory.js:54:44)
    at events.(anonymous function).forEach.handler (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/Dispatcher.js:34:47)
    at Array.forEach (<anonymous>)
    at Dispatcher.fire (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/Dispatcher.js:34:28)
    at Mix.dispatch (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/src/Mix.js:119:25)
    at Object.<anonymous> (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/laravel-mix/setup/webpack.config.js:19:5)
    at Module._compile (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at WEBPACK_OPTIONS (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/webpack-cli/bin/convert-argv.js:133:13)
    at requireConfig (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/webpack-cli/bin/convert-argv.js:135:6)
    at /Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/webpack-cli/bin/convert-argv.js:142:17
    at Array.forEach (<anonymous>)
    at module.exports (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/webpack-cli/bin/convert-argv.js:140:15)
    at yargs.parse (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/webpack-cli/bin/cli.js:241:39)
    at Object.parse (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/yargs/yargs.js:567:18)
    at /Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/webpack-cli/bin/cli.js:219:8
    at Object.<anonymous> (/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/webpack-cli/bin/cli.js:538:3)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/artemdegtarev/.npm/_logs/2018-12-25T12_15_08_490Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `npm run development -- --watch --watch-poll`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/artemdegtarev/.npm/_logs/2018-12-25T12_15_08_528Z-debug.log


В логах:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'watch' ]
2 info using npm@6.5.0
3 info using node@v8.12.0
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle @~prewatch: @
6 info lifecycle @~watch: @
7 verbose lifecycle @~watch: unsafe-perm in lifecycle true
8 verbose lifecycle @~watch: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/artemdegtarev/Desktop/projects/WEB/Cibus/node_modules/.bin:~/.composer/vendor/bin:/usr/local/opt/php@7.1/sbin:/usr/local/opt/php@7.1/sbin:/usr/local/opt/php@7.1/sbin:/usr/local/opt/php@7.1/bin:/usr/local/mysql/bin:/Users/artemdegtarev/.rvm/gems/ruby-2.3.0/bin:/Users/artemdegtarev/.rvm/gems/ruby-2.3.0@global/bin:/Users/artemdegtarev/.rvm/rubies/ruby-2.3.0/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/go/bin:/Users/artemdegtarev/.rvm/bin
9 verbose lifecycle @~watch: CWD: /Users/artemdegtarev/Desktop/projects/WEB/Cibus
10 silly lifecycle @~watch: Args: [ '-c', 'npm run development -- --watch --watch-poll' ]
11 silly lifecycle @~watch: Returned: code: 1  signal: null
12 info lifecycle @~watch: Failed to exec watch script
13 verbose stack Error: @ watch: `npm run development -- --watch --watch-poll`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:915:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid @
15 verbose cwd /Users/artemdegtarev/Desktop/projects/WEB/Cibus
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "watch"
18 verbose node v8.12.0
19 verbose npm  v6.5.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ watch: `npm run development -- --watch --watch-poll`
22 error Exit status 1
23 error Failed at the @ watch script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]


Проект совершенно новый, еще ни одной строчки не написал
Пробовал все обновить, использовать --watch-poll но ошибка не исчезает
В чем может быть причина?

Еще команда sudo npm install -g npm не работает.. Возможно в этом корень всех проблем:
MBP-Artem-2:etc artemdegtarev$ sudo npm install -g npm
Password:
npm WARN tar EISDIR: illegal operation on a directory, open '/tmp/npm-20794-97880182/unpack-e520f238/bin/node-gyp-bin'
npm WARN tar EISDIR: illegal operation on a directory, open '/tmp/npm-20794-97880182/unpack-e520f238/changelogs'
npm WARN tar EISDIR: illegal operation on a directory, open '/tmp/npm-20794-97880182/unpack-e520f238/doc/cli'
npm WARN tar EISDIR: illegal operation on a directory, open '/tmp/npm-20794-97880182/unpack-e520f238/doc/spec'
npm WARN tar EISDIR: illegal operation on a directory, open '/tmp/npm-20794-97880182/unpack-e520f238/html/doc/cli'
...
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/yargs/locales'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/yargs/node_modules/y18n'
npm WARN enoent ENOENT: no such file or directory, open '/private/tmp/npm-20794-97880182/unpack-e520f238/node_modules/run-queue/package.json'

npm ERR! path /private/tmp/npm-20794-97880182/unpack-e520f238/node_modules/run-queue/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/private/tmp/npm-20794-97880182/unpack-e520f238/node_modules/run-queue/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/artemdegtarev/.npm/_logs/2018-12-25T12_22_45_262Z-debug.log
  • Вопрос задан
  • 214 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы