我angular在1.5.11的依赖项中:
{
"dependencies": {
"angular": "1.5.11",
"angular-foundation": "0.7.0"
}
}
Run Code Online (Sandbox Code Playgroud)
angular-foundation碰巧依赖angular@>=1.3.0.
为什么Yarn安装angular@1.6.9为angular-foundation的嵌套依赖项而不是使用项目的版本?这会导致角度在应用程序中存在两次并且无法正常工作:
node_modules
angular (1.5.11)
angular-foundation (0.7.0)
node_modules
angular (1.6.9)
使用npm@5.6.0不会发生这种情况 - npm对应用程序和包使用1.5.11.
我似乎总是遇到nginx配置问题.我的SPA位于/ mnt/q/app(启用了pushstate),前端根位于客户端/公共端.应该将所有内容映射到index.html,应用程序会选择路由并决定要执行的操作.
索引的完整路径是/mnt/q/app/client/public/index.html.
我想我现在用完了选项.无论我做什么,我只是从nginx获得404,我认为配置很简单,并且不知道什么是错的.
server {
listen 80;
server_name app.dev;
root /mnt/q/app;
location / {
root /client/public;
try_files $uri @rewrites =404;
}
location @rewrites {
rewrite ^(.+)$ /index.html last;
}
}
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏.