Closed iva2k closed 6 years ago
Looks like package.json generator has hardcoded "src/" for this line in "scripts":
"start": "ts-node --files src/",
However, with changing it to:
"start": "ts-node --files server/",
it gets a little further, but then there's another error:
C:\dev\ionic3-feathersplus-try2\api>npm start
> api@0.0.0 start C:\dev\ionic3-feathersplus-try2\api
> ts-node --files server/
C:\dev\ionic3-feathersplus-try2\api\node_modules\ts-node\src\index.ts:261
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: Γ¿» Unable to compile TypeScript:
server/app.hooks.ts(4,30): error TS7016: Could not find a declaration file for module 'feathers-hooks-common'. 'C:/dev/ionic3-feathersplus-try2/api/node_modules/feathers-hooks-common/lib/index.js' implicitly has an
'any' type.
Try `npm install @types/feathers-hooks-common` if it exists or add a new declaration (.d.ts) file containing `declare module 'feathers-hooks-common';`
at createTSError (C:\dev\ionic3-feathersplus-try2\api\node_modules\ts-node\src\index.ts:261:12)
at getOutput (C:\dev\ionic3-feathersplus-try2\api\node_modules\ts-node\src\index.ts:367:40)
at Object.compile (C:\dev\ionic3-feathersplus-try2\api\node_modules\ts-node\src\index.ts:557:11)
at Module.m._compile (C:\dev\ionic3-feathersplus-try2\api\node_modules\ts-node\src\index.ts:439:43)
at Module._extensions..js (module.js:663:10)
at Object.require.extensions.(anonymous function) [as .ts] (C:\dev\ionic3-feathersplus-try2\api\node_modules\ts-node\src\index.ts:442:12)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! api@0.0.0 start: `ts-node --files server/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the api@0.0.0 start 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! C:\Users\~~~\AppData\Roaming\npm-cache\_logs\2018-07-18T16_45_04_576Z-debug.log
Found hardcoded "src" in tsconfig.json:
"include": [
"src/index.ts",
"src/typings.d.ts"
],
Changed to:
"include": [
"server/index.ts",
"server/typings.d.ts"
],
after that npm start
works ok, server runs.
Fixes published as f+/cli v0.4.15
Thanks for all the stuff you are finding.
@eddyystop Welcome! Thanks for fixing them right away!
The issue came back.
npm install -g @feathers-plus/cli
mkdir feathers-app
cd feathers-app
feathers-plus generate options
# choose all defaults, except "Generate TypeScript code?" Yes
feathers-plus generate app
# choose all defaults, except enter different folder for source files, e.g. 'server'
Now grepping for 'src':
package.json:
"start:seed": "cross-env NODE_ENV= ts-node --files src/ --seed",
tsconfig.json:
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
No way for me to reopen this, filed new issue:
Steps to reproduce
Then run
Expected behavior
Server should compile and run.
Actual behavior
Server fails to start: