sass / node-sass

:rainbow: Node.js bindings to libsass
https://npmjs.org/package/node-sass
MIT License
8.5k stars 1.33k forks source link

[Old node-sass] node-gyp errors arm64 #3082

Closed alokjethanandani closed 3 years ago

alokjethanandani commented 3 years ago
node:internal/modules/cjs/loader:927
  throw err;
  ^

Error: Cannot find module 'node-sass'
Require stack:
- /Users/alok/[eval]
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at [eval]:1:1
    at Script.runInThisContext (node:vm:131:12)
    at Object.runInThisContext (node:vm:308:38)
    at node:internal/process/execution:77:19
    at [eval]-wrapper:6:22
    at evalScript (node:internal/process/execution:76:60) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/alok/[eval]' ]
}

Context

I'm trying to build my personal website that uses Foundation for Sites 6 on an Apple M1 arm64 architecture.

I installed the foundation CLI using the command npm install foundation-cli --global. This process finished without any errors.

What should happen?

What happens instead?

2021-04-08T20_51_46_101Z-debug.log 2021-04-08T20_52_50_708Z-debug.log 2021-04-08T20_57_52_850Z-debug.log 2021-04-08T21_23_47_918Z-debug.log 2021-04-08T21_27_50_420Z-debug.log 2021-04-08T21_31_02_191Z-debug.log 2021-04-08T21_33_04_745Z-debug.log 2021-04-08T21_37_04_929Z-debug.log

However, when I go to the directory that contains the website and try to build it using npm install I get the following errors:

npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /Users/alok/dev/mm3/node_modules/gulp-sass/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /Users/alok/.nvm/versions/node/v15.14.0/bin/node /Users/alok/dev/mm3/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
saper commented 3 years ago

Which C++ compiler are you using? It is probably too old.

alokjethanandani commented 3 years ago

@saper Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 12.0.0 (clang-1200.0.32.29) Target: arm64-apple-darwin20.3.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

saper commented 3 years ago

3358 verbose pkgid node-sass@3.13.1

This is the problem, you need node-sass@5.0.0 - check https://github.com/alokjethanandani/mm3/blob/eaae2e6ce5a713654c51f6c74b084225f9459a14/package-lock.json#L7489

alokjethanandani commented 3 years ago

@saper I've updated my package.json file to include the latest node-sass. However, I'm still running into issues.

npm ERR! code 128
npm ERR! command failed
npm ERR! command git clone --mirror -q ssh://git@github.com/gulpjs/gulp.git /Users/alok/.npm/_cacache/tmp/git-clone-ae8c81bf/.git
npm ERR! fatal: destination path '/Users/alok/.npm/_cacache/tmp/git-clone-ae8c81bf/.git' already exists and is not an empty directory.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alok/.npm/_logs/2021-04-08T23_08_41_225Z-debug.log

Log file: 2021-04-08T23_08_41_225Z-debug.log

Package.json

{
  "name": "foundation-zurb-template",
  "version": "1.0.0",
  "description": "Official ZURB Template for Foundation for Sites.",
  "main": "gulpfile.js",
  "scripts": {
    "preinstall": "npx npm-force-resolutions",
    "start": "gulp",
    "build": "gulp build --production"
  },
  "author": "ZURB <foundation@zurb.com>",
  "license": "MIT",
  "devDependencies": {
    "babel-core": "^6.26.0",
    "babel-preset-es2015": "^6.3.13",
    "babel-register": "^6.26.0",
    "browser-sync": "^2.10.0",
    "gulp": "github:gulpjs/gulp#4.0",
    "gulp-autoprefixer": "^3.1.0",
    "gulp-babel": "^6.1.2",
    "gulp-clean-css": "^3.3.1",
    "gulp-concat": "^2.5.2",
    "gulp-extname": "^0.2.0",
    "gulp-ftp": "^1.1.0",
    "gulp-if": "^2.0.0",
    "gulp-imagemin": "^2.2.1",
    "gulp-load-plugins": "^1.1.0",
    "node-sass": "^5.0.0",
    "gulp-sass": "^2.1.0",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-uglify": "^1.2.0",
    "gulp-uncss": "^1.0.1",
    "js-yaml": "^3.4.6",
    "panini": "^1.3.0",
    "rimraf": "^2.4.3",
    "style-sherpa": "^1.0.0",
    "yargs": "^3.8.0"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/zurb/foundation-zurb-template.git"
  },
  "bugs": {
    "url": "https://github.com/zurb/foundation-sites/issues",
    "email": "foundation@zurb.com"
  },
  "resolutions": { 
    "graceful-fs": "^4.2.4"
  },
  "babel": {
    "presets": [
      "es2015"
    ]
  },
  "private": true,
  "dependencies": {
    "babel": "^6.23.0",
    "foundation-sites": "^6.4.4-rc1",
    "gulp-cli": "^2.0.1"
  }
}
saper commented 3 years ago

1236 silly placeDep node_modules/gulp-sass node-sass@3.13.1 OK for: gulp-sass@2.3.2 want: ^3.4.2

gulp-sass wants still to have old node-sass - even if you update it it will not work

See https://github.com/dlmanning/gulp-sass/issues/778 and other gulp-sass issues. Sorry for that.