Home>

Why is index.js not being generated?
・ Make Node.js the recommended version
-Reinstall node_modules and install again locally
・Reinstall node_modules and install globally
It was the same even if I tried. ..

The code is below.
Thanks for your cooperation.

fuhixx-2:gulptest-stylelint fuhixx$gulp
Error: Cannot find module'stylelint'
Require stack:
-/Users/fuhixx/gulp success save file /gulptest-stylelint/node_modules/gulp-stylelint/src/index.js
-/Users/fuhixx/gulp success save file /gulptest-stylelint/gulpfile.js
-/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/shared/require-or-import.js
-/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js
-/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/index.js
-/usr/local/lib/node_modules/gulp/bin/gulp.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
    at Function.Module._load (internal/modules/cjs/loader.js:898:27)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:18)
    at Object. (/Users/fuhixx/gulp success save file /gulptest-stylelint/node_modules/gulp-stylelint/src/index.js:5:28)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19) {
  code:'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/fuhixx/gulp success save file /gulptest-stylelint/node_modules/gulp-stylelint/src/index.js',
    '/Users/fuhixx/gulp success save file /gulptest-stylelint/gulpfile.js',
    '/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/shared/require-or-import.js',
    '/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js',
    '/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/index.js',
    '/usr/local/lib/node_modules/gulp/bin/gulp.js'
  ]
}


Below is a piece of code I tried with npm ↓

fuhixx-2:gulptest-stylelint fuhixx$node -v
v14.4.0
fuhixx-2:gulptest-stylelint fuhixx$npm init -y
Wrote to /Users/fuhixx/gulp success save file /gulptest-stylelint/package.json:
{
  "name": "gulptest-stylelint",
  "version": "1.0.0",
  "description": "",
  "main": "gulpfile.js","scripts": {
    "test": "echo \"Error: no test specified\"&&exit 1"
  },


  "keywords": [],


  "author": "",
  "license": "ISC"
}

fuhixx-2:gulptest-stylelint fuhixx$npm i -D gulp gulp-notify gulp-plumber gulp-sass gulp-sass-glob gulp-html-beautify gulp-stylelint gulp-autoprefixer gulp-uglify browser-sync
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
^[⸨░░░░░░░░░░░░░░░░░░⸩ ⠧ fetchMetadata: sill resolveWithNewModule [email protected] check^[⸨░░░░░░░░░ ░░░░⸩⠦ loadDep:strip-ansi: sill resolveWithNewModule wrap-ansinpm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
>[email protected] install /Users/fuhixx/gulp success save file /gulptest-stylelint/node_modules/fsevents
>node install.js
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node
>[email protected] install /Users/fuhixx/gulp success save file /gulptest-stylelint/node_modules/node-sass
>node scripts/install.js
Cached binary found at /Users/fuhixx/.npm/node-sass/4.14.1/darwin-x64-72_binding.node
>[email protected] postinstall /Users/fuhixx/gulp success save file /gulptest-stylelint/node_modules/node-sass
>node scripts/build.js
Binary found at /Users/fuhixx/gulp success storage file /gulptest-stylelint/node_modules/node-sass/vendor/darwin-x64-72/binding.node
Testing binary
Binary is fine
npm notice created a lockfile as package-lock.json.You should commit this file.
npm WARN [email protected] requires a peer of [email protected]^13.0.0 but none is installed.You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
added 677 packages from 458 contributors and audited 677 packages in 24.87s
9 packages are looking for fundingrun `npm fund` for details
found 6 vulnerabilities (3 low, 3 high)
  run `npm audit fix` to fix them, or `npm audit` for details
fuhixx-2:gulptest-stylelint fuhixx$node -v
v12.18.1
fuhixx-2:gulptest-stylelint fuhixx$npm uninstall -D gulp-stylelint
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
removed 12 packages and audited 665 packages in 4.249s
8 packages are looking for funding
  run `npm fund` for details
found 6 vulnerabilities (3 low, 3 high)
  run `npm audit fix` to fix them, or `npm audit` for details
fuhixx-2:gulptest-stylelint fuhixx$npm i -g gulp-stylelint
npm WARN [email protected] requires a peer of [email protected]^13.0.0 but none is installed.You must install peer dependencies yourself.
+ [email protected]
updated 1 package in 1.194s
fuhixx-2:gulptest-stylelint fuhixx$gulp
Error: Cannot find module'gulp-stylelint'
Require stack:
-/Users/fuhixx/gulp success save file /gulptest-stylelint/gulpfile.js
-/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/shared/require-or-import.js
-/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js
-/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/index.js
-/usr/local/lib/node_modules/gulp/bin/gulp.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (/Users/fuhixx/gulp success save file /gulptest-stylelint/gulpfile.js:13:23)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19) {
  code:'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/fuhixx/gulp success save file /gulptest-stylelint/gulpfile.js',
    '/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/shared/require-or-import.js',
    '/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js',
    '/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/index.js',
    '/usr/local/lib/node_modules/gulp/bin/gulp.js'
  ]
}
fuhixx-2:gulptest-stylelint fuhixx$
  • Answer # 1

    Error: Cannot find module'stylelint'

    Please install stylelint.