gulp-sourcemaps: Cannot find module './src/init' - gulp

I get an error while installing React-native, I have tried to search for an answer, but I can not find one.
When running "react-native init meet" I get this error:
This will walk you through creating a new React Native project in /Users/alfred/React/meet
Installing react-native package from npm...
Setting up new React Native app in /Users/alfred/React/meet
module.js:338
throw err;
^
Error: Cannot find module './src/init'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/alfred/React/meet/node_modules/react-native/node_modules/yeoman-generator/node_modules/download/node_modules/vinyl-fs/node_modules/gulp-sourcemaps/index.js:4:9)
at Module._compile (module.js:434:26)
at Module._extensions..js (module.js:452:10)
at Object.require.extensions.(anonymous function) [as .js] (/Users/alfred/React/meet/node_modules/react-native/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
I don't really get what is wrong...

It's related to an issue with gulp-sourcemaps recent deployment https://github.com/floridoo/gulp-sourcemaps/issues/238
A project maintainer says at the end of the thread that he'll get to it today and
For the time being lock your version down to 2.0.x or 1.7.x
To fix, add specific version in your package.json until the issue is fixed:
{
"devDependencies": {
"gulp-sourcemaps": "1.7.x"
}
}
Use npm shrinkwrap to prevent similar issues in the future.

This is caused by a recent change in gulp-sourcemaps. See bug here: https://github.com/floridoo/gulp-sourcemaps/issues/238

This is now fixed. Run npm install
https://github.com/floridoo/gulp-sourcemaps/issues/238

Related

How to make Prettier plugin work in PhpStorm?

I installed the Prettier plugin, installed Prettier with npm into my project, and when I try to use it to reformat something, it acts like there's a bug in Prettier. Here's what I get.
<...>node_modules\prettier\index.js:12947
} catch {
^
SyntaxError: Unexpected token {
at new Script (vm.js:51:7)
at createScript (vm.js:136:10)
at Object.runInThisContext (vm.js:197:10)
at Module._compile (module.js:613:28)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
Process finished with exit code -1
Any ideas?
My guess is that you're running an old version of Node.js that doesn't support optional catch binding. What Node.js version is chosen in Settings | Languages & Frameworks | Node.js?

Custom GitHub Action failing with MODULE_NOT_FOUND

I have a basic custom js GitHub action which is executing a fetch call to an API. However, I'm getting a MODULE_NOT_FOUND error. I've tried different versions of node-fetch etc but haven't been able resolve the error. Has anyone encountered this error? And if so do you know how to resolve?
My Action repository is https://github.com/ReleaseNotesHub/GitHubPullAction
Error
Error: Cannot find module '/home/runner/work/GitHubPullAction/GitHubPullAction/node_modules/is-plain-object/dist/is-plain-object.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:297:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:528:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:784:27)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/runner/work/GitHubPullAction/GitHubPullAction/node_modules/#octokit/endpoint/dist-node/index.js:5:21)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32) {
code: 'MODULE_NOT_FOUND',
path: '/home/runner/work/GitHubPullAction/GitHubPullAction/node_modules/is-plain-object/package.json',
requestPath: 'is-plain-object'
}
The file node_modules/is-plain-object/dist/is-plain-object.js (which it's looking for) is not in your git repo. It's in your local client, but git add . is ignoring it because dist/ is in your .gitignore. This is a very default setup, but it breaks github actions.

Error Deploying gRPC with node on a Google Cloud Function

I'm trying to deploy the Google Assisant SDK in Node.js to a Google Cloud Function but running into this error..
Deployment failure:
Function failed on loading user code. Error message: Code in file index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-linux-x64-glibc
Found: [node-v64-darwin-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module '/srv/google-assistant-grpc/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node'
at Object.<anonymous> (/srv/google-assistant-grpc/node_modules/grpc/src/grpc_extension.js:53:17)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/srv/google-assistant-grpc/node_modules/grpc/src/client_interceptors.js:144:12)
at Module._compile (module.js:653:30
From searching online, it looks like I need to rebuild with a specific binary. So in my package.json I added this, but that doesn't seem to have done anything. To deploy I'm simply zipping everything up and uploading it to the Google Cloud Function interface. Any ideas?
"scripts": {
"postinstall": "npm rebuild --target=8.1.0 --target_platform=linux --target_arch=x64 --target_libc=glibc --update-binary"
}

Cheerio errors at runtime when built using rollup, dependency resolution seems to be the issue

Hi I've been trying to use cheerio in my node library and found this error, i've narrowed it down to rollup not correctly getting the dependency other then that I'm at a loss
enviroment
OS macOS Mojave Version 10.14.3
Node v11.4.0
Rollup 1.6.0
Cheerio 1.0.0-rc.2
repo with error https://github.com/lukecollier/cheerio-rollup-problems
i get a stack trace with
util.js:307
throw new ERR_INVALID_ARG_TYPE('superCtor', 'Function', superCtor);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "superCtor" argument must be of type Function. Received type undefined
at inherits (util.js:307:11)
at Object.<anonymous> (/Users/collierl/Project/Learn/cheerio-rollup-problem/index.js:10575:1)
at Module._compile (internal/modules/cjs/loader.js:723:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:776:12)
at executeUserCode (internal/bootstrap/node.js:342:17)
at startExecution (internal/bootstrap/node.js:276:5)
when I look into the output javascript it seems that it's a rollup error not adding the right dependencies but I want to make sure I'm not missing something before opening a issue

Run a polymer command like `polymer help`, it always throws an error

I am trying to follow polymer tutorial: https://www.polymer-project.org/1.0/start/toolbox/set-up
When I run a polymer command like polymer help, it allways throws the following error:
C:\(...)\npm\node_modules\polymer-cli\bin\polymer.js:19
let lib = path ? require(path) : require('..');
^^^
SyntaxError: Unexpected strict mode reserved word
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
I already reinstalled Polymer cli, but it returns allways the same error.
I found the solution!
I reinstalled node js and now I can run Polymer.
Maybe I had an unsuported version of node js.