Running the iOS runscript causes the following error. Any advice?
This happens to the sample project
/bin/sh -c /Users/aryan.ghassemi/Library/Developer/Xcode/DerivedData/FrontPage-djowwaikrpnoghhjhlxriwamylsv/Build/Intermediates/FrontPage.build/Debug-iphonesimulator/FrontPage.build/Script-9F672F2E1DB0053600974171.sh
/Users/aryan.ghassemi/.nvm/versions/node/v4.2.6/lib/node_modules/apollo-codegen/lib/cli.js:41
const [name, value] = header.split(/\s*:\s*/);
^
SyntaxError: Unexpected token [
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3
The version of Apollo.framework in your project requires apollo-codegen 0.15, but an unknown older version seems to be installed. Installing...
/Users/aryan.ghassemi/.nvm/versions/node/v4.2.6/bin/apollo-codegen -> /Users/aryan.ghassemi/.nvm/versions/node/v4.2.6/lib/node_modules/apollo-codegen/lib/cli.js
+ apollo-codegen#0.15.2
updated 1 package in 1.363s
++ exec apollo-codegen generate ./PostListViewController.graphql ./PostTableViewCell.graphql --schema schema.json --output API.swift
/Users/aryan.ghassemi/.nvm/versions/node/v4.2.6/lib/node_modules/apollo-codegen/lib/cli.js:41
const [name, value] = header.split(/\s*:\s*/);
^
SyntaxError: Unexpected token [
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3
Command /bin/sh failed with exit code 1
Script was running on an older version of node, updating to 6.9 fixed the issue
Related
I just cloned a repository ( a React Native project) from Github, ran npm install and then npm start.
Then instead of running the metro bundler, it throws the following error:
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module './lib/source-map-generator'
Require stack:
- D:\ProjectX\node_modules\snapdragon\node_modules\source-map\source-map.js
- D:\ProjectX\node_modules\snapdragon\lib\utils.js
- D:\ProjectX\node_modules\snapdragon\lib\compiler.js
- D:\ProjectX\node_modules\snapdragon\index.js
- D:\ProjectX\node_modules\sane\node_modules\braces\lib\braces.js
- D:\ProjectX\node_modules\sane\node_modules\braces\index.js
- D:\ProjectX\node_modules\sane\node_modules\micromatch\index.js
- D:\ProjectX\node_modules\sane\node_modules\anymatch\index.js
- D:\ProjectX\node_modules\sane\src\common.js
- D:\ProjectX\node_modules\jest-haste-map\build\lib\WatchmanWatcher.js
- D:\ProjectX\node_modules\jest-haste-map\build\index.js
- D:\ProjectX\node_modules\metro-core\src\errors\AmbiguousModuleResolutionError.js
- D:\ProjectX\node_modules\metro-core\src\index.js
- D:\ProjectX\node_modules\metro\src\node-haste\DependencyGraph.js
- D:\ProjectX\node_modules\metro\src\Bundler.js
- D:\ProjectX\node_modules\metro\src\IncrementalBundler.js
- D:\ProjectX\node_modules\metro\src\Server.js
- D:\ProjectX\node_modules\metro\src\shared\output\bundle.js
- D:\ProjectX\node_modules\#react-native-community\cli-plugin-metro\build\commands\bundle\buildBundle.js
- D:\ProjectX\node_modules\#react-native-community\cli-plugin-metro\build\commands\bundle\bundle.js
- D:\ProjectX\node_modules\#react-native-community\cli-plugin-metro\build\commands\bundle\index.js
- D:\ProjectX\node_modules\#react-native-community\cli-plugin-metro\build\commands\index.js
- D:\ProjectX\node_modules\#react-native-community\cli-plugin-metro\build\index.js
- D:\ProjectX\node_modules\react-native\node_modules\#react-native-community\cli\build\commands\index.js
- D:\ProjectX\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js
- D:\ProjectX\node_modules\react-native\cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (D:\ProjectX\node_modules\snapdragon\node_modules\source-map\source-map.js:6:30)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'D:\\ProjectX\\node_modules\\snapdragon\\node_modules\\source-map\\source-map.js',
'D:\\ProjectX\\node_modules\\snapdragon\\lib\\utils.js',
'D:\\ProjectX\\node_modules\\snapdragon\\lib\\compiler.js',
'D:\\ProjectX\\node_modules\\snapdragon\\index.js',
'D:\\ProjectX\\node_modules\\sane\\node_modules\\braces\\lib\\braces.js',
'D:\\ProjectX\\node_modules\\sane\\node_modules\\braces\\index.js',
'D:\\ProjectX\\node_modules\\sane\\node_modules\\micromatch\\index.js',
'D:\\ProjectX\\node_modules\\sane\\node_modules\\anymatch\\index.js',
'D:\\ProjectX\\node_modules\\sane\\src\\common.js',
'D:\\ProjectX\\node_modules\\jest-haste-map\\build\\lib\\WatchmanWatcher.js',
'D:\\ProjectX\\node_modules\\jest-haste-map\\build\\index.js',
'D:\\ProjectX\\node_modules\\metro-core\\src\\errors\\AmbiguousModuleResolutionError.js',
'D:\\ProjectX\\node_modules\\metro-core\\src\\index.js',
'D:\\ProjectX\\node_modules\\metro\\src\\node-haste\\DependencyGraph.js',
'D:\\ProjectX\\node_modules\\metro\\src\\Bundler.js',
'D:\\ProjectX\\node_modules\\metro\\src\\IncrementalBundler.js',
'D:\\ProjectX\\node_modules\\metro\\src\\Server.js',
'D:\\ProjectX\\node_modules\\metro\\src\\shared\\output\\bundle.js',
'D:\\ProjectX\\node_modules\\#react-native-community\\cli-plugin-metro\\build\\commands\\bundle\\buildBundle.js',
'D:\\ProjectX\\node_modules\\#react-native-community\\cli-plugin-metro\\build\\commands\\bundle\\bundle.js',
'D:\\ProjectX\\node_modules\\#react-native-community\\cli-plugin-metro\\build\\commands\\bundle\\index.js',
'D:\\ProjectX\\node_modules\\#react-native-community\\cli-plugin-metro\\build\\commands\\index.js',
'D:\\ProjectX\\node_modules\\#react-native-community\\cli-plugin-metro\\build\\index.js',
'D:\\ProjectX\\node_modules\\react-native\\node_modules\\#react-native-community\\cli\\build\\commands\\index.js',
'D:\\ProjectX\\node_modules\\react-native\\node_modules\\#react-native-community\\cli\\build\\index.js',
'D:\\ProjectX\\node_modules\\react-native\\cli.js'
]
}
Does anybody know how to solve the above issue?
Thanks in advance.
Try removing node_modules and repeat the npm install or yarn.
If that still doesn’t work, maybe try removing package-lock.json/yarn.lock and repeat the above.
Deploying generated app with JHipster(version: 5.8.2) to AWS using aws-containers sub-generator gives ERROR! Cannot find module 'aws-sdk'
$ jhipster import-jdl blog.jh.
Content of blog.jh:
application {
config {
baseName blog,
applicationType monolith,
packageName org.jhipster.blog,
authenticationType jwt,
prodDatabaseType mysql,
cacheProvider no,
enableHibernateCache false,
buildTool maven,
clientFramework angularX,
useSass false,
testFrameworks [protractor]
}
entities *
}
entity Blog {
name String required minlength(3),
handle String required minlength(2)
}
entity Entry {
title String required,
content TextBlob required,
date Instant required
}
entity Tag {
name String required minlength(2)
}
relationship ManyToOne {
Blog{user(login)} to User,
Entry{blog(name)} to Blog
}
relationship ManyToMany {
Entry{tag(name)} to Tag{entry}
}
paginate Entry, Tag with infinite-scroll
$ jhipster aws-containers
INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing jhipster:aws-containers
INFO! Options: from-cli: true
ERROR! Cannot find module 'aws-sdk'
{ Error: Cannot find module 'aws-sdk'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/generator-jhipster/generators/aws-containers/lib/ssm.js:19:13)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3) code: 'MODULE_NOT_FOUND' }
$ npm install aws-sdk gave
ERROR! Cannot find module 'ora'
$ npm install ora
And it came to:
$ jhipster aws-containers
INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing jhipster:aws-containers
INFO! Options: from-cli: true
This AWS generator will help you deploy your JHipster app as a Docker container on AWS.
✔ Docker is installed
Installing AWS dependencies
✔ AWS credentials using profile default.
events.js:174
throw er; // Unhandled 'error' event
^
TypeError: ora is not a function
at spinner (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/generator-jhipster/generators/aws-containers/aws-client.js:120:21)
at Object.listRegions (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/generator-jhipster/generators/aws-containers/aws-client.js:142:12)
at module.exports.fetchRegion (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/generator-jhipster/generators/aws-containers/index.js:159:22)
at Object.<anonymous> (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/yeoman-generator/lib/index.js:418:27)
at /home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/run-async/index.js:25:25
at new Promise (<anonymous>)
at /home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/run-async/index.js:24:19
at self.env.runLoop.add.completed (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/yeoman-generator/lib/index.js:419:13)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
Emitted 'error' event at:
at Immediate.setImmediate (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/yeoman-generator/lib/index.js:427:22)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
at process.topLevelDomainCallback (domain.js:120:23)
I have recently started Lambda function development on AWS. When try to import a JavaScript file I am getting the following error,and I have also used DynamoDb
module initialization error: TypeError
at Object.<anonymous> (/var/task/index.js:14:16)
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)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
This is my code which I have zipped along with node modules and package.json
const alexaSDK = require('alexa-sdk');
const awsSDK = require('aws-sdk');
const promisify = require('es6-promisify');
awsSDK.config.update({
region: "us-west"
});
//const appId = 'REPLACE WITH YOUR SKILL APPLICATION ID';
const recipesTable = 'Recipes';
const docClient = new awsSDK.DynamoDB.DocumentClient();
// convert callback style functions to promises
const dbScan = promisify(docClient.scan, docClient);
const dbGet = promisify(docClient.get, docClient);
const dbPut = promisify(docClient.put, docClient);
const dbDelete = promisify(docClient.delete, docClient);
I have installed everything that is needed.Could anyone help with this error.
I'm currently developing a C++ addon for NodeJS using the abstraction layer Nan. I would like to make a PostgreSQL request from this addon. But I get the following error:
module.js:597
return process.dlopen(module, path._makeLong(filename));
^
Error: ....cpp/build/Release/MyModule.node: undefined symbol: _ZTVN4pqxx14connect_directE
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (...cpp/test.js:1:77)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
Here is my binding.gyp:
{
"targets": [
{
"target_name": "MyModule",
"sources": [ "Main.cpp"],
"include_dirs": [
"<!(node -e \"require('nan')\")"
],
"cflags": [
"-fexceptions",
"-lpq",
"-lpqxx"
],
"cflags_cc": [
"-fexceptions",
"-lpq",
"-lpqxx"
]
}
]
}
And my Main.cpp file
#include <nan.h>
#include <iostream>
#include <pqxx/pqxx>
using namespace Nan;
using namespace v8;
using namespace std;
using namespace pqxx;
NAN_METHOD(MyModule) {
// Database connection
connection C(
"dbname = ... \
user = ... \
password = ... \
hostaddr = 127.0.0.1 \
port = 5432");
}
NAN_MODULE_INIT(Init) {
Nan::Set(target, New<String>("MyModule").ToLocalChecked(),
GetFunction(New<FunctionTemplate>(MyModule)).ToLocalChecked());
}
NODE_MODULE(parser, Init)
I'm stuck with this error and I didn't find any solution on the web. I would be nice if someone could help!
dlopen tries to load a shared library. However, this library misses a symbol, _ZTVN4pqxx14connect_directE. To decode it:
$ c++filt _ZTVN4pqxx14connect_directE`
vtable for pqxx::connect_direct
Therefore, you need to link a library to your library (addon), which has this symbol. (The postgres driver?)
Make sure your build system doesn't delay the linking, and the lib appears when your run ldd your_addon. If the driver is installed to a non-standard directory, you can experiment with setting LD_LIBRARY_PATH, as a temporary solution.
I am trying to make a Node extension per...
http://nodejs.org/api/addons.html#addons_hello_world
With a couple minor modifications (mine is called helloworld.cc and testnode.js) but when I try to compile the following line...
require('./build/Release/helloworld');
I get the following ST
node.js:242
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: invalid argument
at Object..node (module.js:475:11)
at Module.load (module.js:351:32)
at Function._load (module.js:309:12)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at Object.<anonymous> (/home/jackie/Desktop/hellonode/testnode.js:1:63)
at Module._compile (module.js:444:26)
at Object..js (module.js:462:10)
at Module.load (module.js:351:32)
at Function._load (module.js:309:12)
an ls of the release directory is ...
total 124
-rw-rw-r-- 1 jackie jackie 70288 2012-04-07 16:16 helloworld_1.o
-rwxrwxr-x 1 jackie jackie 49431 2012-04-07 16:16 helloworld.node
Thanks
Jackie
The name of the .node file needs to match the name in the NODE_MODULE macro.
NODE_MODULE(hello, init);
needs to be changed to
NODE_MODULE(helloworld, init);