本文介绍了错误“ env”不能识别为内部或外部命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是node.js的新手,我已经安装了node.js并使用推荐的npm -v检查了它的工作正常,我试图测试它是否从

I am new to node.js i have installed node.js and checked its working fine using commend npm -v , I tried to test it build open source poject from

github https://github.com/quran/quran.com-frontend

运行项目的命令是

  npm run dev

我收到此错误

    C:\Users\Acer\Desktop\quran.com-frontend-master\quran.com-frontend-master>npm run dev

    > quran@1.0.0 dev C:\Users\Acer\Desktop\quran.com-frontend-master\quran.com-frontend-master
    > env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node ./webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 node ./bin/server.js

    'env' is not recognized as an internal or external command,
    operable program or batch file.
    'env' is not recognized as an internal or external command,
    operable program or batch file.

    npm ERR! Windows_NT 10.0.14393
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
    npm ERR! node v6.9.2
    npm ERR! npm  v3.10.9
    npm ERR! code ELIFECYCLE
    npm ERR! quran@1.0.0 dev: `env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node ./webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 node ./bin/server.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the quran@1.0.0 dev script 'env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node ./webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 node ./bin/server.js'.
    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 quran package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node ./webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 node ./bin/server.js
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR!     npm bugs quran
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR!     npm owner ls quran
    npm ERR! There is likely additional logging output above.
    npm WARN Local package.json exists, but node_modules missing, did you mean to install?

    npm ERR! Please include the following file with any support request:
    npm ERR!     C:\Users\Acer\Desktop\quran.com-frontend-master\quran.com-frontend-master\npm-debug.log


推荐答案

Nodejs npm 是不同的。 npm(节点程序包管理器)用于安装nodejs的依赖项。服务器所需的依赖项将在package.json文件中列出。
看来env模块有问题。尝试使用npm安装

Nodejs and npm are different. npm(node package manager) is used to install dependencies of nodejs. The required dependencies for a server will be listed in package.json file.Looks like there is an issue with env module. Try installing the dotenv module using npm

npm install dotenv --save

在安装此模块之前,请使用以下命令更新您的npm

Before installing this module, update your npm using the command

npm update

这篇关于错误“ env”不能识别为内部或外部命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 15:13
查看更多