首页 > 解决方案 > Gulp 在 VS2017 中退出了女巫代码 1 - 构建失败

问题描述

尝试构建 mvc 解决方案时出现错误。 The command "gulp" exited with code 1 当我转到输出窗口时,我可以看到这个

1>  ReferenceError: primordials is not defined
1>      at fs.js:47:5
1>      at req_ (C:\Work\tiptimes\MvcApplication\node_modules\natives\index.js:143:24)
1>      at Object.req [as require] (C:\Work\tiptimes\MvcApplication\node_modules\natives\index.js:55:10)
1>      at Object.<anonymous> (C:\Work\tiptimes\MvcApplication\node_modules\graceful-fs\fs.js:1:37)
1>      at Module._compile (node:internal/modules/cjs/loader:1095:14)
1>      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
1>      at Module.load (node:internal/modules/cjs/loader:975:32)
1>      at Function.Module._load (node:internal/modules/cjs/loader:816:12)
1>      at Module.require (node:internal/modules/cjs/loader:999:19)
1>      at require (node:internal/modules/cjs/helpers:93:18)

我将全局变量设置NODE_PATH为引用 npm/modules。

这是我的依赖项列表:

  "engines": {
    "node": "5.9.1",
    "npm": "3.7.3"
  },
  "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-concat": "^2.6.0",
    "gulp-less": "^3.1.0",
    "gulp-minify-css": "^1.2.4",
    "gulp-sourcemaps": "^2.3.0",
    "gulp-uglify": "^2.0.0",
    "gulp-util": "^3.0.7",
    "merge-stream": "^1.0.0"
  }
}

标签: node.jsasp.net-mvcvisual-studio-2017gulp

解决方案


推荐阅读