polyserve is not working on local development environment - polymer

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

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?

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"
}

Polymer 2 client runtime error

I installed polymer using the recommended syntax:
npm install -g polymer-cli#next
I created a polymer 2 element using the polymer init interface.
The issue I'm having is when I run polymer serve, I get the following error:
error: cli runtime exception: SyntaxError: Unexpected token [
error: SyntaxError: Unexpected token [
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:413:25)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/usr/local/lib/node_modules/polymercli/node_modules/polyserve/lib/start_server.js:33:30)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)`
I tried uninstalling and reinstalling polymer, but getting the same issue. Any ideas??
Fixed my polymer client error.
It turns out the new version of polymer required node v6 or higher.. barely noticed that notice message when I installed.

Gulp watch task was working fine, but is now generating an error when I try to start it

I'm working on a course project using gulp. Gulp has been working fine for weeks, but today I sat down at my computer to continue the course and am getting an error when I try and start my gulp watch task. Again, this has been working fine for weeks prior to today.
When I attempt to run gulp watch I get the following error:
module.js:471
throw err;
^
Error: Cannot find module 'lodash._basevalues'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/rockypruitt/Google Drive/Web Design and
Development/Learning to Code/Udemy-Git a web developer job - Brad
Schiff/Sites/travel-site/node_modules/lodash.template/index.js:11:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
Any assistance will be appreciated.
Rocky you should try with Remove node_modules folder and run npm install again.

Error: Cannot find module 'gulp-uglifyjs' with "gulp watch

I´m in my project folder on my terminal, and:
if I extecute:
gulp -v
I get:
[15:47:15] CLI version 3.9.0
[15:47:15] Local version 3.9.0
if I excute:
gulp watch
I get:
Error: Cannot find module 'gulp-uglifyjs'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/Applications/XAMPP/xamppfiles/htdocs/last/gulpfile.js:3:14)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
Then, I search in the gulpfile.js 3:14 and I see this:
var uglify = require('gulp-uglifyjs');
I was read about this, a lot people say "oh, do npm install", I do, and after make npm -v I get this:
3.3.12
I was trying with a lot commands, but I dont know what happen. Maybe gulpfile.js?
Maybe I forgot a dependencie?
Maybe I forgot a dependencie?
Yes maybe local installation will resolve you problem. Run next command in you project:
npm install --save-dev gulp-uglify
Try to replace
require('gulp-uglifyjs');
with
require('gulp-uglify');
see also https://www.npmjs.com/package/gulp-uglify