satoryu / yaba

Yet Another Blog on Azure
1 stars 0 forks source link

Failed to generate assets with npm run dev #20

Closed satoryu closed 6 years ago

satoryu commented 6 years ago

When executing npm run dev, the following error appears:

npm WARN npm npm does not support Node.js v10.7.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/

> @ development /Users/tatsuya.b.sato/Projects/private/yaba
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

 95% emitting

 ERROR  Failed to compile with 2 errors                                                                                                                4:59:20 PM

 error  in ./resources/assets/sass/app.scss

Module build failed: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.6.0
    at module.exports (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/node-sass/lib/binding.js:13:13)
    at Object.<anonymous> (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/sass-loader/lib/loader.js:3:14)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at loadLoader (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/loadLoader.js:13:17)
    at iteratePitchingLoaders (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/loader-runner/lib/loadLoader.js:36:3)

 @ ./resources/assets/sass/app.scss 4:14-266
 @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
satoryu commented 6 years ago

Found an issue to this probom https://github.com/sass/node-sass/issues/1764 In the comments, npm rebuild node-sass worked for many people but it doesn't for me šŸ˜­ My case might different from that case.

satoryu commented 6 years ago
In file included from ../../nan/nan.h:192:
../../nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet' in 'v8::Object'
  return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
         ~~~  ^
In file included from ../src/binding.cpp:1:
../../nan/nan.h:834:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/tatsuya.b.sato/.node-gyp/10.7.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/tatsuya.b.sato/.node-gyp/10.7.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../src/binding.cpp:1:
../../nan/nan.h:849:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/tatsuya.b.sato/.node-gyp/10.7.0/include/node/node.h:164:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/tatsuya.b.sato/.node-gyp/10.7.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../src/binding.cpp:1:
../../nan/nan.h:864:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/tatsuya.b.sato/.node-gyp/10.7.0/include/node/node.h:157:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/tatsuya.b.sato/.node-gyp/10.7.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../src/binding.cpp:1:
../../nan/nan.h:1473:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return scope.Escape(node::MakeCallback(
                              ^
/Users/tatsuya.b.sato/.node-gyp/10.7.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/tatsuya.b.sato/.node-gyp/10.7.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
4 warnings and 1 error generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/Cellar/node/10.7.0/bin/node" "/Users/tatsuya.b.sato/Projects/private/yaba/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/tatsuya.b.sato/Projects/private/yaba/node_modules/node-sass
gyp ERR! node -v v10.7.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.6.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.6.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/tatsuya.b.sato/.npm/_logs/2018-08-04T08_04_15_716Z-debug.log
satoryu commented 6 years ago

This problem looks to be because some packages aren't compatible with node.js v10. Someone reported downgrading to v9 resolves this problem.

satoryu commented 6 years ago
nvm install v9.11.2
rm -rf node_modules
npm install
npm run-script dev

Build Successful!