As of yesterday (08/15/2019) Puppeteer install is failing to download chromium. Gets a 403 from storage.googleapis.com. Looks like maybe this is a change on google's side and puppeteer should be using commondatastorage.googleapis.com as the base download url? Just wondering if anyone else is seeing this problem.
I am aware we can skip the chromium download, but we need it for unit tests on a build server that does not have chrome installed.
Updating to latest puppeteer (1.19.0) made no difference.
puppeteer#1.19.0 install /node_modules/puppeteer
node install.js
ERROR: Failed to download Chromium r674921! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
Error: Download failed: server returned code 403. URL: https://storage.googleapis.com/chromium-browser-snapshots/Mac/674921/chrome-mac.zip
at response (<project dir>/node_modules/puppeteer/lib/BrowserFetcher.js:232:21)
at ClientRequest.requestCallback (<project dir>/node_modules/puppeteer/lib/BrowserFetcher.js:297:7)
at Object.onceWrapper (events.js:273:13)
at ClientRequest.emit (events.js:182:13)
at HTTPParser.parserOnIncomingClient (_http_client.js:555:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
at TLSSocket.socketOnData (_http_client.js:441:20)
at TLSSocket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
-- ASYNC --
at BrowserFetcher.<anonymous> (<project dir>/node_modules/puppeteer/lib/helper.js:111:15)
at Object.<anonymous> (<project dir>/node_modules/puppeteer/install.js:64:16)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
sudo npm install puppeteer --unsafe-perm=true --allow-root
Related
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"
}
I created a simple javascript file called hello.js which has the code console.log('Node is installed!'); As you can see in the screenshot I have installed node and npm. You can see the version in the screenshot. I am currently in the directory where my hello.json file resides. Now when I type node hello.json in my cygwin terminal it gives me the following error module.js:674
throw err;
^ SyntaxError: C:\Users\SAHNN002\Documents\Testing\hello.json: Unexpected token c in JSON at position 0
at JSON.parse (<anonymous>)
at Object.Module._extensions..json (module.js:671:27)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
I am pretty much new to node js. Please help me solve this problem.
All of a sudden, I'm getting this while trying to run ionic. What's wrong?
My Laptop Suddenly Crashes and when I restarted my System and Open Ionic in Code Editor it shows the Following Error:
Unable to parse Ionic Config file. Please make sure it is valid JSON (.ionic/ionic.config)
Caught exception:
SyntaxError: Unexpected token
at Object.parse (native)
at Object.module.exports.load (C:\Users\BBytes\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\lib\config.js:14:26)
at Object.<anonymous> (C:\Users\BBytes\AppData\Roaming\npm\node_modules\ionic\lib\utils\stats.js:31:31)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\BBytes\AppData\Roaming\npm\node_modules\ionic\lib\cli.js:3:18)
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
After Some trial and Error:
I think I have found the source of my problem!
My C:/Users/{username}/.ionic/ionic.config file was corrupted when my pc crashed /or due to some other error.
Weird that that file NEVER gets cleared when uninstalling ionic.
Just Delete the file and when you run ionic serve it will create the file by default in the folder.
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
I am trying to launch polyserve on my local development environment but it is not working. thought it might be due to node.js updated node but still getting this error.
/usr/local/lib/node_modules/polyserve/bin/polyserve:14
const resolve = require('resolve'); ^^^^^ SyntaxError: Use of const in
strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
According to my copy of polyserv, its package.json file says it needs the resolve module
https://www.npmjs.com/package/resolve
Your error is that it can't find it.
Is polyserve installed locally - run npm install