# Angualr 環境安裝問題排除 ### 問題 :Package '@angular/cli' is not a dependency. 刪除了node_module **sol :** npm i ### 問題 : Cannot find module '../run-schematic/executor' Sol : npm i -D @angular-devkit/core @angular-devkit/schematics 可以 Run : ng update --all --force ### 問題 : Error: Failed to compile entry-point ng-zorro-antd/comment (module as esm5) due to compilation errors: Sol : npm install ng-zorro-antd ### 問題 : Cannot find module '@angular-devkit/build-angular/package.json' npm install --save-dev @angular-devkit/build-angular ### 問題 : Could not find the implementation for builder @angular-devkit/build-angular:dev-server ### 問題 : The "@angular-devkit/schematics" package cannot be resolved from the workspace root directory. Sol : npm ls @angular-devkit/schematics npm install @angular-devkit/schematics ### 問題 : Package '@angular/animations' is not a dependency. npm i ### 問題 : 更新node.js Please update your Node.js version curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash nvm list. / Mac 要下 nvm ls nvm install 14.18.1 nvm use 14.18.1 ### 問題 : ng' does not support the 'serve' target. npm install, npm run-script build , finally ng serve. ### 問題 : npm install debug 解決套件相依性問題 npm install --legacy-peer-deps ``` code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: odemy-ng@1.9.0 npm ERR! Found: @angular/common@13.0.3 npm ERR! node_modules/@angular/common npm ERR! @angular/common@"~13.0.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/common@"^11.0.4" from @vime/angular@5.3.1 npm ERR! node_modules/@vime/angular npm ERR! @vime/angular@"^5.3.1" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See /Users/jimmyxiao/.npm/eresolve-report.txt for a full report. ``` ### 問題 : Can't bind to 'formGroup' since it isn't a known property of 'form'. Sol : NgModule 加入 Component 要import 正確的 檔 案 import { SharedModule } from 'src/app/shared/shared.module'; ### 問題 : Generic type 'MapHandlerMap < T> ' requires 1 type argument(s). ============== googel map 引入問題 run npm i @types/googlemaps@3.39.13 --save-dev 就可以了 ### 問題 : 無法更新 anuglar cli npm ERR! code EACCES npm ERR! syscall rename code EACCES npm ERR! syscall rename npm ERR! path /Users/xxxxx/.nvm/versions/node/v18.19.0/lib/node_modules/@angular/cli 解決方法, 加sudo sudo npm install -g @angular/cli 或試著移除再安裝 npm uninstall -g @angular/cli ###### tags: `Angular` `FrontEnd`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up