D:\works\ui>gulp
ReferenceError: primordials is not defined
    at fs.js:42:5
    at req_ (D:\works\ui\node_modules\natives\index.js:143:24)
    at Object.req [as require] (D:\works\ui\node_modules\natives\index.js:55:10)
    at Object.<anonymous> (D:\works\ui\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:37)
    at Module._compile (node:internal/modules/cjs/loader:1275:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
    at Module.load (node:internal/modules/cjs/loader:1133:32)
    at Module._load (node:internal/modules/cjs/loader:972:12)
    at Module.require (node:internal/modules/cjs/loader:1157:19)
    at require (node:internal/modules/helpers:119:18)

 
D:\works\ui>gulp -v
CLI version: 3.0.0
Local version: 3.8.11

 参考这个文档:

ReferenceError primordials is not defined 报错和解决_referenceerror: primordials is not defined-CSDN博客


D:\works\ui>node -v
v19.9.0

我的nvm配置settings.txt:

root: C:\ProgramData\nvm
arch: 64
proxy: none
originalpath: .
originalversion: 
node_mirror: https://npmmirror.com/mirrors/node/
npm_mirror: https://npmmirror.com/mirrors/npm/

nvm没有低版本,直接官网下:

 解压到我的nvm目录:

需要重命名:

D:\works\ui>nvm ls

    19.9.0
    18.12.0
    18.7.0
    16.16.0
    14.20.0
    10.24.1
  * 0.12.18 (Currently using 64-bit executable)
    0.10.48

D:\works\ui>nvm use 10.24.1
Now using node v10.24.1 (64-bit)

D:\works\ui>nvm ls

    19.9.0
    18.12.0
    18.7.0
    16.16.0
    14.20.0
  * 10.24.1 (Currently using 64-bit executable)
    0.12.18
    0.10.48

D:\works\ui>npm -v
6.14.12

D:\works\ui>node -v
v10.24.1

D:\works\ui>rd /s /q .\node_modules
.\node_modules\browser-sync\node_modules\localtunnel\node_modules\yargs\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\normalize-package-data\node_modules\resolve\node_modules\is-core-module\node_modules\hasown\node_modules\function-bind - 系统找不到指定的路径。
.\node_modules\browser-

.......................................... 省略。。。。。。。。。。。。。。。。。。。。。

D:\works\ui>gulp -v 
CLI version: 3.0.0
Local version: 3.8.11 

  "dependencies": {

    "browser-sync": "^1.7.1",

    "gulp": "^3.8.11",

    "gulp-autoprefixer": "^2.3.1",

    "gulp-clean": "^0.3.2",

    "gulp-concat": "^2.5.2",

    "gulp-if": "~1.2.2",

    "gulp-jade": "~1.0.0",

    "gulp-plumber": "0.6.2",

    "gulp-sass": "^3.2.1",

    "gulp-watch": "~4.2.1",

    "node-gyp": "^10.1.0",

    "node-sass": "^5.0.0",

    "npm": "^2.15.12"

  }

node-sass编译最磨人,这里github有预编译的二进制:

D:\works\ui>npm install gulp-sass@3.2.1
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated glob@7.1.7: Glob versions prior to v9 are no longer supported
npm WARN deprecated osenv@0.1.5: This package is no longer supported.
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated fstream@1.0.12: This package is no longer supported.

> node-sass@4.14.1 install D:\works\ui\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-64_binding.node
Download complete..] - :
Binary saved to D:\works\ui\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-64\binding.node
Caching binary to C:\Users\Administrator\AppData\Roaming\npm-cache\node-sass\4.14.1\win32-x64-64_binding.node

> node-sass@4.14.1 postinstall D:\works\ui\node_modules\gulp-sass\node_modules\node-sass
> node scripts/build.js

Binary found at D:\works\ui\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-64\binding.node
Testing binary
Binary is fine
npm WARN uxbox-ui@0.0.0 No repository field.
npm WARN uxbox-ui@0.0.0 license should be a valid SPDX license expression

 

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐