Problems with Node Extension - c++

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);

Related

Error after upgrade from nuxt2.15 to nuxt-bridge

I was upgrade nuxt2.15 to nuxt-bridge
and run npm run dev
but there is error.
I tried to fix it, but I couldn't fix it.
I think this is error about #nuxt/babel-preset-app
but, I don't know what should i do.
#nuxt/babel-preset-app version is 2.15.8
this is error log message
[nuxt] [request error] Module parse failed: Identifier directly after number (68:14)
File was processed with these loaders:
* ./node_modules/unplugin/dist/webpack/loaders/transform.js
* ./node_modules/unplugin/dist/webpack/loaders/transform.js
* ./node_modules/cache-loader/dist/cjs.js
* ./node_modules/thread-loader/dist/cjs.js
* ./node_modules/babel-loader/lib/index.js
* ./node_modules/unplugin/dist/webpack/loaders/transform.js
You may need an additional loader to handle the result of these loaders.
| },
| maxPrice: {
> krw: 1_000_000,
| usd: 900
| }
at Object../conf.ts (./.nuxt/dist/server/server.js:10811:7)
at __webpack_require__ (./.nuxt/dist/server/server.js:27:30)
at Module../node_modules/unplugin/dist/webpack/loaders/transform.js?unpluginName=nuxt%3Aimports-transform!./node_modules/unplugin/dist/webpack/loaders/transform.js?unpluginName=nuxt-legacy-vue-transform!./node_modules/cache-loader/dist/cjs.js?!./node_modules/thread-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/unplugin/dist/webpack/loaders/transform.js?unpluginName=nuxt-legacy-capi-key-transform!./layouts/error.vue?vue&type=script&lang=js& (./.nuxt/dist/server/server.js:30113:63)
at __webpack_require__ (./.nuxt/dist/server/server.js:27:30)
at Module../layouts/error.vue?vue&type=script&lang=js& (./.nuxt/dist/server/server.js:11046:578)
at __webpack_require__ (./.nuxt/dist/server/server.js:27:30)
at Module../layouts/error.vue (./.nuxt/dist/server/server.js:10998:93)
at __webpack_require__ (./.nuxt/dist/server/server.js:27:30)
at Module../.nuxt/index.js (./.nuxt/dist/server/server.js:907:76)
at __webpack_require__ (./.nuxt/dist/server/server.js:27:30)
Thank you!

Error: Cannot find module './lib/source-map-generator'

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 JHipster generated app to AWS via ECS using AWS Fargate errors

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)

Apollo runscript failing on iOS?

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

SmartyCompilerException error during testlink installation

i followed step by step the installation of testink with wamp server.
everything was fine except the last step, when i open the link:
http://localhost/testlink-1.9.14/login.php
i got this:
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "C:\wamp\www\testlink-1.9.14\gui\templates\login.tpl" on line 23 "{if $tlCfg-&gt;demoMode}{$labels.demo_usage}{/if}" unknown tag "private_print_expression"' in C:\wamp\www\testlink-1.9.14\third_party\smarty3\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 665
( ! ) SmartyCompilerException: Syntax Error in template "C:\wamp\www\testlink-1.9.14\gui\templates\login.tpl" on line 23 "{if $tlCfg-&gt;demoMode}{$labels.demo_usage}{/if}" unknown tag "private_print_expression" in C:\wamp\www\testlink-1.9.14\third_party\smarty3\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 665
Call Stack
# Time Memory Function Location
1 0.0006 303984 {main}( ) ..\login.php:0
2 0.1015 8857432 renderLoginScreen( ) ..\login.php:75
3 0.1034 8972560 Smarty_Internal_TemplateBase->display( ) ..\login.php:230
4 0.1034 8976768 Smarty_Internal_TemplateBase->fetch( ) ..\smarty_internal_templatebase.php:374
5 0.1047 9006248 Smarty_Internal_Template->compileTemplateSource( ) ..\smarty_internal_templatebase.php:155
Can you help me please, thank you
I suggest to change the persmission of the gui and third_party folder
chmod -R 777 gui/
chmod -R 777 third_party/