node-icu-wordsplit
node-icu-wordsplit copied to clipboard
I can't install with npm command
It's show like this when 'npm install node-icu-wordsplit' was complete.
../src/wordsplit.cc: In function ‘void wordsplit::SplitWords(const Nan::FunctionCallbackInfov8::Value&)’:
../src/wordsplit.cc:38:55: error: invalid conversion from ‘uint16_t* {aka short unsigned int*}’ to ‘const UChar* {aka const char16_t*}’ [-fpermissive]
icu::UnicodeString uTextArg(cTextArg, text->Length());
^
In file included from /usr/local/include/unicode/brkiter.h:45:0,
from ../src/wordsplit.cc:3:
/usr/local/include/unicode/unistr.h:2911:3: error: initializing argument 1 of ‘icu_50::UnicodeString::UnicodeString(const UChar*, int32_t)’ [-fpermissive]
UnicodeString(const UChar *text,
^
make: *** [Release/obj.target/wordsplit/src/wordsplit.o] Error 1
make: Leaving directory /mnt/d/BeamRobotic/OneDrive/SourceCodes/Flowaccount_Projects/test/node_modules/icu-wordsplit/build' gyp ERR! build error gyp ERR! stack Error:
make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-43-Microsoft
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /mnt/d/BeamRobotic/OneDrive/SourceCodes/Flowaccount_Projects/test/node_modules/icu-wordsplit
gyp ERR! node -v v8.5.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /home/beamrobotic/.npm/_logs/2017-09-23T12_00_10_594Z-debug.log
- The correct command is
npm install icu-wordsplit
- What OS, OS distribution, CPU architecture, G++ version are you using?
- Do you have installed the ICU development package for your OS/distribution (for example -
apt-get install libicu-devel
for Debian, Ubuntu, etc)?
@vladwing I'm on debian-burster. I get another build same error:
Traceback (most recent call last):
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
sys.exit(gyp.script_main())
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
return main(sys.argv[1:])
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
return gyp_main(args)
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 523, in gyp_main
options.duplicate_basename_check)
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 139, in Load
params['parallel'], params['root_targets'])
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2779, in Load
variables, includes, depth, check, True)
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 417, in LoadTargetBuildFile
build_file_data, PHASE_EARLY, variables, build_file_path)
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 1296, in ProcessVariablesAndConditionsInDict
build_file)
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 1311, in ProcessVariablesAndConditionsInList
ProcessVariablesAndConditionsInDict(item, phase, variables, build_file)
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 1296, in ProcessVariablesAndConditionsInDict
build_file)
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 1315, in ProcessVariablesAndConditionsInList
expanded = ExpandVariables(item, phase, variables, build_file)
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 914, in ExpandVariables
sys.stderr.write(p_stderr)
TypeError: write() argument must be str, not bytes while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.9.184-linuxkit
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node_modules/icu-wordsplit
gyp ERR! node -v v12.13.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-12-17T11_53_17_588Z-debug.log
I have installed icu:
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
build-essential \
pkg-config \
libicu-dev \
python3.7-icu
In fact it works when in Python:
import icu
from icu import Locale,BreakIterator
#...