Failed at the @ watch script 'cross-env NODE_ENV=development 使用cross-env解决跨平台设置NODE_ENV的问题

今天在安装js依赖包时,根目录的package.json:

{
  "private": true,
  "scripts": {
    "dev": "$npm_package_scripts_development",
    "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": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "prod": "$npm_package_scripts_production",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "axios": "^0.15.3",
    "bootstrap": "^3.3.7",
    "cross-env": "^3.2.3",
    "jquery": "^3.1.1",
    "laravel-mix": "0.*",
    "lodash": "^4.17.4",
    "swiper": "^3.4.2"
  },
  "dependencies": {
    "cross-env": "^3.2.4"
  }
}

在执行nmp install时出现以下错误

谷歌了下这个cross-env迷你的包能够提供一个设置环境变量的scripts,让你能够以unix方式设置环境变量,

安装使用方法:

  • 安装cross-env: npm install cross-env --save-dev
  • NODE_ENV=xxxxxxx前面添加cross-env就可以了(本例中已经加了cross-env)。
    在此执行npm install,ok 正常

Failed at the @ watch script 'cross-env NODE_ENV=development 使用cross-env解决跨平台设置NODE_ENV的问题

时间: 2024-10-06 12:09:45

Failed at the @ watch script 'cross-env NODE_ENV=development 使用cross-env解决跨平台设置NODE_ENV的问题的相关文章

使用cross-env解决跨平台设置NODE_ENV的问题

使用方法: 安装cross-env:npm install cross-env --save-dev 在NODE_ENV=xxxxxxx前面添加cross-env就可以了. 原文地址:https://www.cnblogs.com/dujunfeng/p/8334120.html

unable to read askpass response from 'C:\Users\..\..\intellij-git-askpass.bat' failed to execute prompt script (exit code 1) could not read Username

原因: 缺少用户认证信息. 解决办法: 在 .git 的 config 配置文件中的请求串中加入用户身份的认证信息. https://[userName]:[password]@github.com/[username]/project.git 例如: [remote "origin"] url = http://wangshzh:[email protected]/zhangyb/dmavip.git fetch = +refs/heads/*:refs/remotes/origin

设置node_env的环境变量

设置process.env.NODE_ENV的环境变量可以用以下2种方式: 1 //在你的app.js文件中设置 2 process.env.NODE_ENV = 'development'; 3 4 //在packgage.json文件中 5 "scripts": { 6 "start": "set NODE_ENV && nodemon ./bin/www" 7 },

【LR11】Error -27796: Failed to connect to server"server:port": [10060] Connection timed out错误解决办法

  场景描述:被测系统是发布在远程服务器上的,假设IP是10.10.10.10,端口是8066,那么访问地址是http://10.10.10.10:8066/,在control机器上我设置了IP欺骗. 错误现象:在场景运行时出现大量Action.c(8): Error -27796: Failed to connect to server"server:port": [10060] Connection timed out错误. 官方的troubleshooting: 查看工具的tro

关于windows下NODE_ENV=test无效的情况解决办法

redux的单元测试命令为 NODE_ENV=test mocha --recursive --compilers js:babel-core/register --require ./test/setup.js 无奈windows下面NODE_ENV不是个命令,无法执行,需要加set set NODE_ENV=test&&mocha --recursive --compilers js:babel-core/register --require ./test/setup.js 然而还是不

Maven错误“Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create ”解决

用maven3新建一个项目时,输入的命令如下: mvn archetype:create 出现错误如下: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-cli) on project standalone-pom: Unable to parse configuration of mojo org.apache.maven.plugins:mav

A Script Pro nginx URL重写规则无法播放MP4解决方法

I am using nginx and I have already add the line location /file/ { rewrite ^/file/([0-9]+)/([0-9]+)/([^/]*)/([0-9]+)/(.*)$ /file.php?id=$1&server=$2&hash=$3&expire=$4&file=$5 last; } in the conf file of the domain. But the videos do not pl

[cross domain] four approachs to cross domain in javascript

four approachs can cross domain in javascript 1.jsonp 2.document.domain(only in frame and they have one same parent domain) 3.window.name 4.window.postMessage(only in Html5) original website:http://www.cnblogs.com/2050/p/3191744.html

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 解决办法

Maven install失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project autotest_fchtgl: Compilation failure[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE r