I've encountered following error when I run my code,
Error: /var/www/courses.com.mm/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: 1: /var/www/mysite.com.mm/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: Syntax error: Unterminated quoted string
at Socket.onStderr (/var/www/mysite.com.mm/node_modules/phridge/lib/spawn.js:93:28)
at emitOne (events.js:101:20)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:547:20)
Please let me know how to solve it. Thanks.
See the following issues on GitHub:
https://github.com/Medium/phantomjs/issues/392
https://github.com/Medium/phantomjs/issues/384
It seems you have installed the binary on 1 platform and run them on another. According to docs NPM expects you to run npm rebuild if you switch platforms, to rebuild any platform-specific dependencies.
see also https://github.com/Medium/phantomjs#cross-platform-repositories for more information.
Related
When running ng serve I get the following error after updating my angular version:
An unhandled exception occurred: Directory import 'C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular-devkit\build-angular\src\dev-server' is not supported
resolving ES modules imported from C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular\cli\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js
Did you mean to import C:/Users/xxx/Documents/desktop-server-client-app/desktop/server/client/node_modules/#angular-devkit/build-angular/src/dev-server/index.js?
See "C:\Users\xxx\AppData\Local\Temp\ng-TMJqg5\angular-errors.log" for further details.
Log output:
[error] Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import 'C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular-devkit\build-angular\src\dev-server' is not supported resolving ES modules imported from C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular\cli\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js
Did you mean to import C:/Users/xxx/Documents/desktop-server-client-app/desktop/server/client/node_modules/#angular-devkit/build-angular/src/dev-server/index.js?
at finalizeResolution (internal/modules/esm/resolve.js:272:17)
at moduleResolve (internal/modules/esm/resolve.js:699:10)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:810:11)
at Loader.resolve (internal/modules/esm/loader.js:85:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:229:28)
at Loader.import (internal/modules/esm/loader.js:164:28)
at importModuleDynamically (internal/modules/cjs/loader.js:1006:27)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14)
at eval (eval at loadEsmModule (C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular\cli\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js:195:12), <anonymous>:3:1)
at loadEsmModule (C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular\cli\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js:195:68)
Could somebody explain to me what this error means and how I could fix it? It seems to me that this is some kind of compatibility problem I can't do much about. My angular project so far just contains some boilerplate code, so it shouldn't be the problem.
Edit: My versions are the following:
Node: 14.15.0
npm: 6.14.8
Angular: 13.2.4
#angular-devkit/architect: 0.1202.16
#angular-devkit/build-angular: 12.2.16
#angular-devkit/core: 12.2.16
#angular-devkit/schematics: 13.2.5
#angular/cdk: 12.2.13
#angular/cli: 13.2.5
#angular/material: 12.2.13
#schematics/angular: 13.2.5
rxjs: 6.6.7
typescript: 4.5.5
I faced this problem because I updated my project to Angular 13 using --legacy-peer-deps flag. Because of that, there were old dependencies still present in package.json.
Make sure you have the appropriate package version regarding the thrown error. In your precise case, try to change
"#angular-devkit/build-angular": "~12.2.16"
to "#angular-devkit/build-angular": "~13.2.5"
then run npm install.
When datejs is installed using npm and when a script (below) is executed, the following error is obtained:
Error: Cannot find module 'datejs'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
datejs module exists under correct node_modules.Thanks in advance.
Try require('./node_modules/datejs/index.js');
I’m installing scrypt (https://www.npmjs.com/package/scrypt) from npm. The installation involves a node-gyp build step that builds a native node.js extension. When I then start my app, it fails with the following error:
node index.js
module.js:568
return process.dlopen(module, path._makeLong(filename));
^
Error: /package/host/localhost/gcc-4/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/xxxx/xxxx/node_modules/scrypt/build/Release/scrypt.node)
at Error (native)
at Object.Module._extensions..node (module.js:568:18)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at Module.require (module.js:466:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/xxxx/xxxx/node_modules/scrypt/index.js:3:20)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at Module.require (module.js:466:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/xxxx/xxxx/node_modules/unfun-cms/lib/utils/password.js:3:16)
which is not so surprising, because
[xxxx#xxxx nodeapp]$ strings /package/host/localhost/gcc-4/lib64/libstdc++.so.6 | grep "GLIBCXX_3\.4\.21"
[xxxx#xxxx nodeapp]$
while
[xxxx#xxxx nodeapp]$ strings /package/host/localhost/gcc-5/lib64/libstdc++.so.6 | grep "GLIBCXX_3\.4\.21"
GLIBCXX_3.4.21
[xxxx#xxxx nodeapp]$
I have
export PATH=/package/host/localhost/gcc-5/bin:$PATH
export LD_LIBRARY_PATH=/package/host/localhost/gcc-5/lib64:$LD_LIBRARY_PATH
in my .bashrc, and gcc --version shows 5.2.0 correctly, so I assume these settings are alright.
So the question is, how do I tell scrypt the path to the correct libstdc++.so.6, namely the one at /package/host/localhost/gcc-5/lib64/libstdc++.so.6? (And why does it even get it wrong?)
EDIT:
This is a CentOS machine. I’m using node.js version 6.1.0, npm version 3.8.6, and I’m trying to install scrypt version 6.0.3, which is the latest version at the time of this writing.
EDIT 2:
I tried to statically link the library by editing node_modules/scrypt/binding.gyp, adding
'libraries': ['/package/host/localhost/gcc-5/lib64/libstdc++.so.6'],
to each of the four specified targets, and then running node-gyp rebuild.
I also tried changing this to
'libraries': ['-L/package/host/localhost/gcc-5/lib64', '-lstdc++'],
, which appears to be syntactically valid, too—but still, it tries to load the library from the wrong path at runtime.
I stubled with a similar trouble and had resolve it with a trick uses dynamic load of libstdc++.so.6 through LD_PRELOAD:
LD_PRELOAD='/path/to/lib/libstdc++.so.6' /usr/bin/nodejs app.js
I have successfully completed the bookstore application and It's been running so far. I wanted to package the application in an WAR file and have it run of a different machine/environment.
Environment:
Windows 7
JDK 8
Maven 3.3.9
NodeJS 5.3
I run the following command
mvn -Pprod package
Issue #1 - Bower execution failed, resolved by updating git config for https:// instead of git://
Issue #2 -Python related errors - Do I need to setup Python?
C:\Source\jhipster-projects\bookstore1\node_modules\utf-8-validate>if not defined npm_config_node_gyp
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
Issue #3 - PhantomJS related errors, I did update PhantomJS still with the same errors
PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 46 of 46 SUCCESS (34.659 secs / 1.536 secs)
←[1A←[2KPhantomJS 1.9.8 (Windows 7 0.0.0): Executed 46 of 46 SUCCESS (34.659 secs / 1.536 secs)
Missing error handler on `socket`.
TypeError: sockets.forEach is not a function
at disconnectBrowsers (C:\Source\jhipster- projects\bookstore1\node_modules\karma\lib\server.js:314:13)
at null.<anonymous> (C:\Source\jhipster- projects\bookstore1\node_modules\karma\lib\server.js:291:7)
at emitTwo (events.js:92:20)
at emit (events.js:172:7)
at emitRunCompleteIfAllBrowsersDone (C:\Source\jhipster- projects\bookstore1\node_modules\karma\lib\server.js:256:12)
at null.<anonymous> (C:\Source\jhipster-projects\bookstore1\node_modules\karma\lib\server.js:278:9)
at emitTwo (events.js:92:20)
at emit (events.js:172:7)
at onComplete (C:\Source\jhipster-projects\bookstore1\node_modules\karma\lib\browser.js:142:13)
at Socket.<anonymous> (C:\Source\jhipster-projects\bookstore1\node_modules\karma\lib\events.js:13:22)
at emitTwo (events.js:92:20)
at Socket.emit (events.js:172:7)
at Socket.onevent (C:\Source\jhipster- projects\bookstore1\node_modules\socket.io\lib\socket.js:335:8)
at Socket.onpacket (C:\Source\jhipster- projects\bookstore1\node_modules\socket.io\lib\socket.js:295:12)
at Client.ondecoded (C:\Source\jhipster-projects\bookstore1\node_modules\socket.io\lib\client.js:193:14)
at Decoder.Emitter.emit (C:\Source\jhipster-projects\bookstore1\node_modules\component-emitter\index.js:134:20)
Thanks
It looks that this issue has been resolved a few hours ago in Karma v0.13.19:
https://github.com/karma-runner/karma/releases/tag/v0.13.19
https://github.com/jhipster/generator-jhipster/issues/2574
Not sure if you fixed it already, but Chris's answer was right. The Karma module needs to be updated in package.json for your project since it specifies which exact version to use, and won't use the newer version that you installed globally.
Change
"karma": "0.13.15",
to
"karma": "0.13.19",
then, run npm install
I'm having this issue when trying to compile speak.js. In emscripten.sh when the compiler reaches this line:
$EMSCRIPTEN/emcc -O2 --js-transform "python bundle.py" speak.bc -o speak.raw.js
I get this error (previous parts work fine):
emscripten
fs.js:338
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT, no such file or directory 'C:\tmp\tmp0Ak4ij.txt'
at Object.fs.openSync (fs.js:338:18)
at Object.fs.readFileSync (fs.js:182:15)
at read (C:\opt\emscripten\src\compiler.js:36:37)
at Object.<anonymous> (C:\opt\emscripten\src\compiler.js:120:29)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
Traceback (most recent call last):
File "/opt/emscripten/emcc", line 871, in <module>
final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
File "/opt/emscripten/tools/shared.py", line 736, in emscripten
assert os.path.exists(filename + '.o.js') and len(open(filename + '.o.js', 'r').read()) > 0, 'Emscripten failed to generate .js: ' + str(compiler_output)
AssertionError: Emscripten failed to generate .js:
cat: speak.raw.js: No such file or directory
I'm running cygwin under windows 7; all emscripten sanity checks worked fine, and I tried changing emscripten /tmp config (.escripten in the home folder) to several values, granting permissions, etc. It seems that the temp file is never created, so when it tries to access it again, it breaks.
Any help/guidance/suggestion is welcome.
In case someone is interested , I'm posting an answer.
unfortunately, I couldn't find the underlying cause, but it doesn't work with cygwin under windows 7 x64.
I was able to compile, however, installing clang, llvm visual studio express ant the rest of the tools in this link
Using emscripten with VS 2010
and do the same thing that's in emscripten.sh with windows console. However it won´t compile with
emcc -O2 --js-transform "python bundle.py" speak.bc -o speak.raw.js
you have to remove the -02 option, and it works. I'm testing the different languages/phonemes and let you know how does it work