node,node_env,cross-env不是内部或外部命令,也不是可运行的程序 或批处理文件。
Posted mysweetheart
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了node,node_env,cross-env不是内部或外部命令,也不是可运行的程序 或批处理文件。相关的知识,希望对你有一定的参考价值。
> blog-1@1.0.0 dev D:frontlearning
odejs-serverlog-1
> cross-env NODE_ENV = dev nodemon ./bin/www.js
‘NODE_ENV‘ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
events.js:173
throw er; // Unhandled ‘error‘ event
^
Error: spawn NODE_ENV ENOENT
at notFoundError (D:frontlearning
odejs-serverlog-1
ode_modules\\_cross-spaw
n@7.0.3@cross-spawnlibenoent.js:6:26)
at verifyENOENT (D:frontlearning
odejs-serverlog-1
ode_modules\\_cross-spawn
@7.0.3@cross-spawnlibenoent.js:40:16)
at ChildProcess.cp.emit (D:frontlearning
odejs-serverlog-1
ode_modules\\_cro
ss-spawn@7.0.3@cross-spawnlibenoent.js:27:25)
at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
Emitted ‘error‘ event at:
at ChildProcess.cp.emit (D:frontlearning
odejs-serverlog-1
ode_modules\\_cro
ss-spawn@7.0.3@cross-spawnlibenoent.js:30:37)
at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! blog-1@1.0.0 dev: `cross-env NODE_ENV = dev nodemon ./bin/www.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the blog-1@1.0.0 dev 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! D:
ode.js
ode_cache\\_logs2020-07-27T13_30_19_644Z-debug.log
‘corss-env‘ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! blog-1@1.0.0 prd: `corss-env NODE_ENV = production nodemon ./bin/www.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the blog-1@1.0.0 prd 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! D:
ode.js
ode_cache\\_logs2020-07-27T13_34_23_515Z-debug.log
后来发现是NODE_ENV后面的等号前面和后面不能有空格
改正后
以上是关于node,node_env,cross-env不是内部或外部命令,也不是可运行的程序 或批处理文件。的主要内容,如果未能解决你的问题,请参考以下文章
Failed at the @ watch script 'cross-env NODE_ENV=development 使用cross-env解决跨平台设置NODE_ENV的问题