简体   繁体   中英

Hostgator npm: npm run watch give error

I had Hostgator cloud sites. I don't know what the problem is.

Installed node & npm correctly.

node -v: v8.11.1

npm -v: 5.6.0

and when I tried to run this command

npm run watch

it gives this error

> @ watch /home2/wgrltz65/wedding.ajdandd.tech
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

sh: cross-env: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! spawn ENOENT
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!     /home2/wgrltz65/.npm/_logs/2018-04-18T19_44_08_103Z-debug.log

when I enter the log I found this log:

0 info it worked if it ends with ok
1 verbose cli [ '/home2/wgrltz65/bin/node',
1 verbose cli   '/home2/wgrltz65/bin/npm',
1 verbose cli   'run',
1 verbose cli   'watch' ]
2 info using npm@5.6.0
3 info using node@v8.11.1
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: /home2/wgrltz65/nodejs/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home2/wgrltz65/wedding.ajdandd.tech/node_modules/.bin:/usr/local/jdk/bin:/home2/wgrltz65/perl5/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/opt/cpanel/composer/bin:/opt/python27/bin:/usr/local/bin:/usr/X11R6/bin:/home2/wgrltz65/bin
9 verbose lifecycle @~watch: CWD: /home2/wgrltz65/wedding.ajdandd.tech
10 silly lifecycle @~watch: Args: [ '-c',
10 silly lifecycle   'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
11 info lifecycle @~watch: Failed to exec watch script
12 verbose stack Error: @ watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
12 verbose stack spawn ENOENT
12 verbose stack     at ChildProcess.<anonymous> (/home2/wgrltz65/nodejs/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack     at emitTwo (events.js:126:13)
12 verbose stack     at ChildProcess.emit (events.js:214:7)
12 verbose stack     at maybeClose (internal/child_process.js:925:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
13 verbose pkgid @
14 verbose cwd /home2/wgrltz65/wedding.ajdandd.tech
15 verbose Linux 3.10.0-693.17.1.2.ELK.el6.x86_64
16 verbose argv "/home2/wgrltz65/bin/node" "/home2/wgrltz65/bin/npm" "run" "watch"
17 verbose node v8.11.1
18 verbose npm  v5.6.0
19 error file sh
20 error code ELIFECYCLE
21 error errno ENOENT
22 error syscall spawn
23 error @ watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
23 error spawn ENOENT
24 error Failed at the @ watch script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

看起来hostgator不支持共享基础结构上的节点: http : //support.hostgator.com/articles/specialized-help/technical/node-js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM